
409 So.2d 1290 (1982)
Charles FRAZIER, dba Frazier's Manufactured Housing, Plaintiff-Appellant,
v.
GREEN STEEL BUILDING, INC., Defendant-Appellee.
No. 14753.
Court of Appeal of Louisiana, Second Circuit.
January 25, 1982.
*1291 Bobby L. Culpepper, Jonesboro, for plaintiff-appellant.
Farrar, Perry & Jefferson by Bennie Mac Farrar, Monroe, for defendant-appellee.
Before MARVIN, JASPER E. JONES and FRED W. JONES, Jr., JJ.
JASPER E. JONES, Judge.
The plaintiff, Charles Frazier, d/b/a Frazier's Manufactured Housing (sometimes hereinafter called Frazier) appeals a judgment sustaining an exception of no right of action and dismissing his action on a contract. We reverse and remand.
Frazier contracted with defendant, Green Steel Building, Inc., for the construction of a building. Green Steel built the structure and Frazier sues for damages allegedly suffered on account of certain defects in the structure.
In support of the exception of no right of action the defendant filed an affidavit which shows that, in order to end the controversy over the building, it had agreed to take a reduced price for the building and plaintiff had agreed to make any needed repairs at its own expense. Plaintiff attached a copy of its check given at time of the compromise to a memorandum which controverted the assertion that it had agreed to make all repairs. The copy of the check contained a statement signed by John Gammill, defendant's representative who had signed the affidavit, which defendant had attached to its exception of no right of action, in which statement Gammill said: "It is understood that the water problem on the front of the building will be corrected." The memorandum and check containing the quoted statement was filed in the record on June 1, 1981.
On June 17, plaintiff filed an affidavit which was in accord with its memo. This affidavit was filed one day after the exception of no right of action was submitted for decision. The district judge refused to consider the facts alleged in plaintiff's memo because it was not sworn to. The exception of no right of action was maintained and plaintiff's action dismissed. Frazier then took this appeal.
On appeal Frazier makes one assignment of error: that it was error for the trial judge to sustain the exception of no right of action. We agree and reverse and remand.
*1292 The exception of no right of action contests whether the plaintiff is in the class to which the law extends a remedy. Gustin v. Shows, 377 So.2d 1325 (La.App. 1st Cir. 1979). Evidence is admissible in support of or opposition to an exception of no right of action. LSA-C.C.P. art. 931; Gustin, supra. The factual evidence admissible is restricted to that which relates to whether or not plaintiff falls into a class having a legal interest to sue upon the cause of action sued upon. Bielkiewicz v. Rudisill, 201 So.2d 136 (La.App. 3d Cir. 1967).
The exception of no right of action is not to be used to urge that the plaintiff is without interest simply because the defendant has a defense to the action. Bielkiewicz, supra; Langley v. Copolymer Rubber and Chemical Corp., 233 So.2d 353 (La.App. 1st Cir. 1970); Guide Newspaper Corporation v. Langford, 363 So.2d 77 (La.App. 4th Cir. 1978).
The plaintiff has alleged that it and the defendant are the parties to a contract which the defendant has breached. The face of the petition and the supplemental and amending petition set forth a cause of action and that plaintiff is the proper party to assert it. The defendant by the affidavit submitted in support of the exception of no right of action attempts to show a compromise. Compromise is an affirmative defense. LSA-C.C.P. art. 1005. Thus, Green Steel is attempting to assert an affirmative defense through an exception of no right of action. This is an improper use of the exception of no right. Bielkiewicz; Langley; Guide Newspaper; supra.
The course adopted by defendant would require a complete adjudication of the merits of the case to determine the exception of no right. This is contra to the purpose and function of the exception of no right of action. Gustin, supra. What the defendant seeks to do through this exception is more properly done through a motion for summary judgment.
We note that the evidence submitted in support of the exception was merely an affidavit. Generally, affidavits are inadmissible because they are hearsay. Miller v. Miller, 226 La. 273, 76 So.2d 3 (1954).
The record contains no indication that the plaintiff or defendant agreed to submit the exception of no right of action to the judge for decision based upon the record, but the briefs of each litigant indicate that the parties entered into such an agreement and under these circumstances it could be argued that a stipulation was made that the defendant's affidavit and defendant's check with the statement of plaintiff's agent written upon it could have been considered by the judge even though both violated the hearsay rule. However, this evidence is totally irrelevant to the exception of no right of action and there is no evidence in the record which shows that plaintiff does not as a matter of law have the legal interest to assert an action against the defendant for damages for breach of contract.
The exception of no right of action should have been overruled. The judgment dismissing plaintiff's action is REVERSED, the exception of no right of action is OVERRULED, and this matter REMANDED for further proceedings. All costs of this appeal are to be borne by appellee, Green Steel Buildings, Inc.
