The primary issues presented for review are (1) whether the Court of Appeals erred in holding that summary judgment was inappropriate for any party because there was a material question of fact as to whether the covenant not to compete had been breached, and (2) if summary judgment was appropriate given the record before the trial judge, whether it was properly entered in favor of one or more defendants. For reasons set forth below, we hold that whether the covenant not to compete was breached is a question of law and therefore the Court of Appeals erroneously remanded the case for determination of whether conduct of one or more of the defendants amounted to a breach. In addition we hold that the trial judge erroneously entered summary judgment in favor of defendants. The decision of the Court of Appeals is reversed and the case remanded to that court for remand to Superior Court, Orange County, with direction to enter summary judgment in favor of plaintiff to the extent set forth below.
In 1973 the three defendants formed a corporation known as Carolina Bikeways, Inc. The defendants were the sole shareholders of Bikeways for most of its existence. Sometime prior to 1980 defendant Bell leased to Bikeways approximately 1,700 square feet of space in a building he owned on West Main Street, Carrboro, North Carolina, so that Bikeways could operate a bicycle sales and repair business known as “The Clean Machine.” The de*221fendants conducted the business of Clean at that location until August 1980. On or about 1 August 1980 Bikeways sold to plaintiff, Bicycle Transit Authority, Inc., all of its assets pursuant to a contract of sale. Ancillary to the contract of sale, and incorporated by reference therein, were a lease to plaintiff of that portion of the building formerly occupied by Bikeways trading as The Clean Machine and a covenant by all defendants not to compete with plaintiff. This covenant provides as follows:1
1. Covenant. The Parties of the First Part [defendants] hereby agree that for a period of seven (7) years from July 30, 1980, they will not jointly or severally (unless they have obtained the Party of the Second Part’s [plaintiff] prior written consent) directly or indirectly be employed by, be associated with, be under contract with, own, manage, operate, join, control or participate in the ownership, management, operation, or control of, or be connected in any manner with, any business which is a competitor of the Party of the Second Part in Durham County or Orange County, North Carolina. The Parties of the First Part acknowledge that remedies at law for any breach of the foregoing will be inadequate and that the Party of the Second Part shall be entitled to injunctive relief. In consideration for such covenant, the Party of the Second Part agrees to pay to the Parties of the First Part (to be divided among the Parties of the First Part as they themselves shall decide and determine) the sum of $30,000. The $30,000 shall accure [sic] interest at the rate of 10% per annum for the period of two years from August 4, 1980, thereby making the unpaid principal and accrued interest the sum of $36,000 at the end of the second full year. This sum of $36,000 shall be paid in a lump sum to the Parties of the Second Part on August 3, 1987. However, at the end of the two year period referred to above, the $36,000 principal and accrued interest thereon shall continue to accrue interest *222at the rate of 10% per annum, which interest shall be paid in equal quarterly installments in the amount of Nine Hundred Dollars ($900.00) each until the above-styled $36,000 sum becomes due and payable on August 3, 1987. The payment of all interest and principal amounts due hereunder shall be by means of a check made jointly payable to the Parties of the First Part and delivered on their behalf to Michael J. Mulligan, Esq., Suite 210, Croisdaile [sic] Office Park, Durham, North Carolina 27705. Delivery of any said payment to Michael J. Mulligan, Esq., shall constitute a full acquittance of the Party of the Second Part for said sum.
On or about 6 October 1982 defendant Bell leased to Alan Garrett Snook a portion of the building occupied by plaintiff. After the lease agreement was executed, Snook orally sublet the premises to Performance Bicycle Shop, Inc. (PBS), a closely-held corporation of which Snook is president and majority shareholder. In lieu of the immediate payment of rent, Snook gave defendant Bell a personal promissory note due 30 September 1983 to cover the first two months’ rent of the leased premises. Snook testified by way of deposition that it was his intent to repay the note and interest from funds paid to him by PBS. Under Snook’s control, PBS began to sell bicycle parts and accessories from the premises. Although most of PBS’s business is conducted through telephone and mail orders, it also caters to a walk-in clientele. The lease agreement between Bell and Snook specifically provides that “the leased premises shall be used by the Lessee to operate a mail order and walk-in bicycle business and may be used for any other lawful purpose.”2 The rent for the premises is paid directly to Bell by PBS.
On 4 November 1982 plaintiff filed a complaint against Bell alleging that he violated the terms of the noncompetition and consulting agreement and that he engaged in unfair and deceptive trade practices affecting commerce. Bell’s answer denied these allegations and counterclaimed for attorney’s fees and for install*223ment payments together with interest due but unpaid under the terms of the covenant executed by defendants and plaintiff. Plaintiff subsequently amended its complaint by adding the other two defendants as parties and seeking injunctive relief and attorney’s fees. Plaintiff replied to Bell’s counterclaim by alleging that plaintiff is excused from any payments due under the noncompetition agreement because Bell materially breached the contract, the consideration for the contract failed, and because of his course of conduct Bell is estopped from claiming any payments otherwise due under the agreement. Ultimately both plaintiff and defendants moved for summary judgment. At a hearing before the superior court all parties stipulated that “the sole legal issue in dispute . . . [is] whether the acts of the defendant Bell as alleged by the plaintiff constituted a violation of the non-competitive covenants contained in the contracts between the parties.” On 27 December 1983 the superior court entered an order denying plaintiffs motion for summary judgment and granting defendants’ motion for summary judgment. The court ordered plaintiff to pay defendants3 monies due under the noncompetition agreement and the costs of the action. Plaintiff appealed to the Court of Appeals which reversed and remanded for trial because of the existence of “a jury question whether Bell’s conduct fell within the contractual anti-competitive provisions.” Defendants appealed pursuant to N.C.G.S. 7A-30(2), and plaintiffs petition for certiorari to consider the issue whether plaintiff should have been granted summary judgment was allowed 23 April 1985.
 As this Court said recently:
The law is succinctly stated in Bone International, Inc. v. Brooks, 304 N.C. 371, 375, 283 S.E. 2d 518, 520 (1981):
A party moving for summary judgment may prevail if it meets the burden (1) of proving an essential element of the opposing party’s claim is nonexistent, or (2) of showing through discovery that the opposing party cannot produce evidence to support an essential element of *224his or her claim. Moore v. Fieldcrest Mills, Inc., 296 N.C. 467, 251 S.E. 2d 419 (1979); Zimmerman v. Hogg & Allen, 286 N.C. 24, 209 S.E. 2d 795 (1974). Generally this means that on “undisputed aspects of the opposing evidential forecast,” where there is no genuine issue of fact, the moving party is entitled to judgment as a matter of law. 2 McIntosh, North Carolina Practice and Procedure § 1660.5, at 73 (2d ed. Supp. 1970). If the moving party meets this burden, the non-moving party must in turn either show that a genuine issue of material fact exists for trial or must provide an excuse for not doing so. Moore v. Fieldcrest Mills, Inc., 296 N.C. at 470, 251 S.E. 2d at 421-22; Zimmerman v. Hogg & Allen, 286 N.C. at 29, 209 S.E. 2d at 798. If the moving party fails to meet his burden, summary judgment is improper regardless of whether the opponent responds. 2 McIntosh, supra. The goal of this procedural device is to allow penetration of an unfounded claim or defense before trial. Id. Thus, if there is any question as to the credibility of an affiant in a summary judgment motion or if there is a question which can be resolved only by the weight of the evidence, summary judgment should be denied. Moore v. Fieldcrest Mills, Inc., 296 N.C. at 470, 251 S.E. 2d at 422.
The standard for summary judgment is fixed by Rule 56(c) of the North Carolina Rules of Civil Procedure. The judgment sought shall be rendered forthwith if the pleadings and other materials before the trial judge show that there is no genuine issue of material fact and that any party is entitled to a judgment as a matter of law. Kessing v. Mortgage Corp., 278 N.C. 523, 180 S.E. 2d 823 (1971).
Broadway v. Blythe Industries, Inc., 313 N.C. 150, 152-53, 326 S.E. 2d 266, 268-69 (1985). Both plaintiff and defendants argue that the sole issue for determination, that is, whether the acts of Bell constituted a violation of the noncompetitive covenant, is a matter of law and that there is no factual issue to be determined by a jury trial. We agree. There is no substantial controversy as to the facts alleged in the materials the parties submitted on behalf of their respective motions for summary judgment. The dispute solely concerns the legal significance of those facts. See Blades v. City of Raleigh, 280 N.C. 531, 187 S.E. 2d 35 (1972). We therefore *225reverse the Court of Appeals because it erroneously held there was a material question of fact whether Bell’s conduct breached the anti-competitive covenant.
We now turn to the questions whether summary judgment was properly entered in favor of defendants or whether it should have been entered in favor of plaintiff.4
In brief, defendants argue that Bell did not breach the covenant not to compete for two reasons:
First, there has been no breach of the literal language of the non-competitive covenant, in that Dr. Bell has no contract or connection with a competitor of plaintiff. The lease complained of by plaintiff is between Dr. Bell and Mr. Snook, not between Dr. Bell and PBS, or any other competing entity. Secondly, even if the court finds a connection between Dr. Bell and PBS, the mere leasing of a place of business to a potential or actual competitor does not constitute a violation of the non-competitive covenants of the contract.
In opposition, plaintiff argues that before Bell executed the lease to Snook, Bell knew that Snook would sublease the premises adjacent to plaintiff s business to a competitor of plaintiff and that the mere fact that Snook’s corporation was technically the competitor should not shield Bell from liability. The lease to Snook contains an option to purchase the entire building, including the portion leased to plaintiff, during the period 30 September 1985 to 1 October 1986. It is also noted that plaintiffs lease expires 31 July 1987 and does not contain any renewal provisions. Plaintiff points out that Bell not only leased the premises to Snook for the purpose of operating a bicycle parts and accessories business, but Bell also loaned Snook $1,722.91 at nine percent interest for eleven and one-half months to cover the first two months of rent on the premises at issue. Snook testified by deposition that the matter of the loan was a “typical business negotiation. You try to get as good a deal as you can . . . .” According to plaintiff this clearly shows that Bell violated the language and the spirit of the covenant.
It is the rule today that when one sells a trade or business and, as an incident of the sale, covenants not to engage in the same business in competition with the purchaser, the covenant is valid and enforceable (1) if it is reasonably necessary to protect the legitimate interest of the purchaser; (2) if it is reasonable with respect to both time and territory; and (3) if it does not interfere with the interest of the public.
The reasonableness of a restraining covenant is a matter of law for the court to decide.
Defendants do not argue that the covenant is unreasonable with respect to time and territory, and we hold that as to these factors the covenant is reasonable. The covenant is limited to a period of seven years within the North Carolina counties of Durham and Orange. These restrictions are reasonable as a matter of law. See, e.g., id. (agreement not to compete with jewelry business for ten years within ten miles); Sineath v. Katzis, 218 N.C. 740, 12 S.E. 2d 671 (1940) (agreement not to compete with dry cleaning plant for fifteen years within county); Sea Food Co. v. Way, 169 N.C. 679, 86 S.E. 603 (1915) (agreement not to compete with fish dealership within one hundred miles of city for ten years). See generally, Annot., 46 A.L.R. 2d 119 (1956); Annot., 45 A.L.R. 2d 77 (1956). In addition, defendants do not argue that the covenant as written is so broad in scope as to either interfere with the interests of the public or that it is not reasonably necessary to protect the legitimate interest of the purchaser,5 and we hold that it is not overbroad and is reasonably necessary to protect plaintiffs interests. Instead, defendants argue that under any reasonable interpretation of the covenant, Bell’s acts did not rise to the level of a breach.
*227It is elementary that when interpreting a contract the intent of the parties is our polar star:
“The heart of a contract is the intention of the parties, which is to be ascertained from the expressions used, the subject matter, the end in view, the purpose sought, and the situation of the parties at the time.” . . . When a contract is in writing and free from any ambiguity which would require resort to extrinsic evidence, or the consideration of disputed fact, the intention of the parties is a question of law. The court determines the effect of their agreement by declaring its legal meaning. . . .
“Intention or meaning in a contract may be manifested or conveyed either expressly or impliedly, and it is fundamental that that which is plainly or necessarily implied in the language of a contract is as much a part of it as that which is expressed. If it can be plainly seen from all the provisions of the instrument taken together that the obligation in question was within the contemplation of the parties when making their contract or is necessary to carry their intention into effect, the law will imply the obligation and enforce it.”
We turn first to the language of the covenant. Acknowledging that the agreement containing the covenant was “absolutely necessary to the successful acquisition of the business by the [plaintiff],” defendants agreed
that for a period of seven (7) years from July 30, 1980, they will not jointly or severally (unless they have obtained the [plaintiffs] prior written consent) directly or indirectly be employed by, be associated with, be under contract with, own, manage, operate, join, control or participate in the ownership, management, operation, or control of, or be connected in any manner with, any business which is a competitor of the [plaintiff] in Durham County or Orange County, North Carolina.
*228Generally, parties are free to contract to anything as long as it is not illegal, unconscionable, or against the public interest. See generally 17 Am. Jur. 2d Contracts § 155 (1964). We have held above that the contract does not adversely affect the public’s interest in, e.g., free trade. Compare Ice Cream Co. v. Ice Cream Co., 238 N.C. 317, 77 S.E. 2d 910 (1953) (agreement not to compete which extended into a territory where the business did not originally operate was held to be detrimental to the public interest and therefore void); Shute v. Shute, 176 N.C. 462, 97 S.E. 392 (1918). The sole issue remaining, therefore, is whether given the broad language of the covenant defendant Bell’s behavior breached the contract.
Not surprisingly, case law discussing whether particular behavior of a party breached a covenant not to compete turns on the scope of the covenant involved. See, e.g., cases discussed in Annot., 1 A.L.R. 3d 778 (1965) and Annot., 14 A.L.R. 2d 1333 (1950). Generally, when deciding whether a party has breached a restrictive covenant ancillary to the sale of a business, courts will interpret the covenant in the light of the purpose of the parties to provide against competition by the covenantor and hold that in order to carry out such purpose the parties must comply not only with the letter of the contract but its spirit as well. Annot., 14 A.L.R. 2d 1333. As one court stated:
The agreement is not to be narrowly, technically, construed. . . . We read in the reports: “There is implied in every contract a covenant by each party not to do anything which will deprive the other parties thereto of the benefits of the contract.” (Harm v. Frasher, 181 Cal. App. 2d 405, 417 [5 Cal. Rptr. 367].) “In every contract there is an implied covenant of good faith and fair dealing that neither party will do anything which injures the right of the other to receive the benefits of the agreement.” (Brown v. Superior Court, 34 Cal. 2d 559, 564 [212 P. 2d 878].) “When a person sells the contents of a store and agrees not to engage in the same business in the same city as long as the purchaser continues in business, the contract is construed as carrying with it the good will of the business.” (Mahlstedt v. Fugit, 79 Cal. App. 2d 562, 566 [180 P. 2d 777].) “When the good will of a business is sold, it is not the patronage of the general public which is sold, but that patronage which has become an asset of that business. *229. . . The law implies in every contract a covenant that neither party will do anything that will deprive the other of the fruits of his bargain.” (Bergum v. Weber, 136 Cal. App. 2d 389, 392 [288 P. 2d 623].)
Harrison v. Cook, 213 Cal. App. 2d 527, 530, 29 Cal. Rptr. 269, 271 (1963). Accord Tillis v. Cotton Mills and Cotton Mills v. Tillis, 251 N.C. 359, 363, 111 S.E. 2d 606, 610 (1959) (“Parties to an executory contract . . . impliedly promise not to do anything to the prejudice of the other inconsistent with their contractual relations. . . .”).
 It is clear from the terms of the covenant at issue in the present case that the parties intended a very general restriction on the defendants with respect to any acts which would promote competition with Bicycle Transit Authority, Inc. in the circumscribed territory within the period of time specified. We hold that Bell breached the covenant not to compete by leasing to Snook the premises adjoining those he had rented to plaintiff with knowledge that Snook intended to establish therein a bicycle business that would compete with plaintiff and by loaning money to Snook to enable him to set up this competing business. By so doing, Bell violated at a minimum the provisions of the covenant that he not be directly or indirectly associated with, be under contract with, or be connected in any manner with any business which is a competitor of plaintiff.
In holding that assistance rendered to another who is engaged or about to engage in a competing business is a breach of a covenant not to compete, we use the test ordinarily applied which is one of weighing the effect of such assistance on the business of the covenantee. If such assistance creates an effect which was as injurious to the covenantee as if the covenantor had acted for himself, or if such assistance was such as would result in mischief, the covenantor has generally been held to have breached his covenant to not compete. See, Wilson v. Delaney, 137 Iowa 636, 113 N.W. 842 (1907); Annot., 1 A.L.R. 3d 778, 788.
Arizona Chuck Wagon Service, Inc. v. Barenburg, 17 Ariz. App. 235, 237, 496 P. 2d 878, 880 (1972). See generally Annot., 1 A.L.R. 3d 778, § 3[b]. See, e.g., Diagnostic Laboratory v. PBL Consultants, 136 Ariz. 415, 666 P. 2d 515 (Ct. App. 1983); Dowd v. Bryce, *23095 Cal. App. 2d 644, 213 P. 2d 500 (1950); Langenback v. Mays, 207 Ga. 156, 60 S.E. 2d 240 (1950); The Vendo Co. v. Stoner, 105 Ill. App. 2d 261, 245 N.E. 2d 263 (1969); Nichols Stores v. Lipschutz, 120 Ohio App. 286, 201 N.E. 2d 898 (1963). But see Foyer Key Sung v. Ramirez, 121 Misc. 2d 313, 467 N.Y.S. 2d 486 (1983). Bell had complete control of the opportunity for the establishment of a competing business in the premises leased to Snook. By leasing to Snook, Bell also positioned himself to receive profits from Snook’s business in the form of rents paid out of the profits made from competing with plaintiff. After arm’s length negotiation and for valuable consideration, the parties entered into a valid covenant not to compete; it is obvious that defendant Bell’s behavior breached both the letter and the spirit of the contract. We hold, therefore, that because Bell breached the covenant not to compete, summary judgment was improperly entered in favor of defendants.
Because the parties stipulated that the sole issue before the trial judge was “whether the acts of defendant Bell as alleged by the plaintiff constituted a violation of the non-competitive covenants contained in the contracts between the parties,” the issue of what remedy may be appropriate for plaintiff is not before this Court. We note that in Marshall v. Miller, 302 N.C. 539, 550, 276 S.E. 2d 397, 404 (1981), except as expressly modified, this Court adopted the opinion of the Court of Appeals, which included the following language:
Where the same course of conduct gives rise to a traditionally recognized cause of action, as, for example, an action for breach of contract, and as well gives rise to a cause of action for violation of G.S. 75-1.1, damages may be recovered either for the breach of contract, or for violation of G.S. 75-1.1, but not for both.
We therefore hold that plaintiff is entitled to summary judgment on the issue of whether Bell’s acts breached the covenant not to compete. The case is remanded to the Court of Appeals for remand to Superior Court, Orange County, for entry of partial summary judgment in favor of plaintiff and for a determination of damages or such other relief as may be appropriate.
*231Reversed and remanded.