
261 N.W.2d 662 (1977)
RUGBY MILLING COMPANY, Plaintiff and Appellee,
v.
Sam LOGOSZ, Defendant and Appellant.
Civ. No. 9340.
Supreme Court of North Dakota.
December 19, 1977.
*663 Paul G. Kloster, of Mackoff, Kellogg, Kirby & Kloster, Dickinson, for plaintiff and appellee.
Dann E. Greenwood, of Greenwood, Greenwood & Greenwood, Dickinson, for defendant and appellant.
VOGEL, Justice.
This is an appeal from a summary judgment on a promissory note executed by the defendant Logosz, a farmer, in favor of Rugby Milling Company, owner and operator of a grain elevator.
We affirm.
Logosz asserts that the trial judge erred in granting Rugby Milling's motion for summary judgment, and particularly in ruling that Logosz failed to affirmatively plead failure of consideration and in ruling that a stipulation and judgment of dismissal of a prior action, with prejudice and on the merits, was res judicata as to the claim in the present action.
The dispute between the parties arose in 1974, after they had dealt with each other for several years. Early in 1974, Logosz went to the office of Rugby Milling for the purpose of selling stored wheat at the then market value of $5.56 per bushel. He was told that Rugby Milling had already sold the wheat at a lower price to pay a prior indebtedness. At a subsequent meeting in the office of Rugby Milling's attorney, at which the status of the account between Logosz and Rugby Milling was discussed, Logosz signed a promissory note to Rugby Milling in the amount of $6,657.79, due October 26, 1974. Logosz asserts that he signed the note intending to sue Rugby Milling later, and that he did not feel he was indebted to the amount of the note. Rugby Milling contends that the promissory note was a novation.
The first action was commenced on September 4, 1974, when Logosz filed a complaint alleging wrongful conversion of his stored grain by Rugby Milling. He asked $3,474.83 damages for conversion and additional damages for fraud, as well as punitive damages. Rugby Milling answered, alleging the novation.
On March 22, 1976, the attorneys for the parties signed a stipulation for dismissal of the complaint "with prejudice and upon the merits" and the stipulation was approved *664 by the court and judgment was entered accordingly.
About three weeks later, the present action was commenced by complaint of Rugby Milling against Logosz to recover on the promissory note. Logosz answered admitting owing some money, but alleged that the amount of the complaint "is excessive and exaggerated and does not truly represent the indebtedness." He also claimed a setoff in the amount of $3,474.83, which, it will be noted, is the exact amount of the conversion claim in the former action which was dismissed with prejudice and on the merits. Rugby Milling moved for summary judgment based in part on Logosz's deposition admitting execution of the note, and Logosz filed a return to the motion and an affidavit. The trial court granted summary judgment in favor of Rugby Milling on two grounds: first, that the setoff claimed by Logosz was determined by the judgment in the prior litigation and was res judicata, and, second, that the execution of the note and the nonpayment of the note were admitted and that failure of consideration was not alleged as a defense. This appeal followed.

I. RES JUDICATA
Our most recent decision involving res judicata is Dolajak v. State Auto and Cas. Underwriters, 252 N.W.2d 180 (N.D.1977). We there held that a matter was res judicata if it was actually decided and determined in the prior action. We cited Knutson v. Ekren, 72 N.D. 118, 5 N.W.2d 74 (1942), in which we held that an issue necessarily involved in the determination of the prior action is res judicata as to a subsequent action. If an issue is necessarily involved in the adjudication, it is actually decided and determined.
No distinction is to be made between judgments entered after stipulation by the parties and judgments entered after trial, unless fraud is involved in the former.
In Rummel v. Rummel, 234 N.W.2d 848, 851 (N.D.1975), we quoted from Harchenko v. Harchenko, 77 N.D. 289, 43 N.W.2d 200 (1950), Syllabus ¶ 1:
"A judgment, entered pursuant to the stipulation of the parties to an action, is as effective an adjudication of the issues in the case as one entered upon an actual trial of such issues."
The Minnesota Supreme Court has recently emphasized the same principle. In the case of Application of Schaefer, 287 Minn. 490, 178 N.W.2d 907, 909 (1970), the court held:
"An order dismissing an action with prejudice operates as an estoppel to litigate again the issue raised in that action."
The court there relied on its previous holding in Pangalos v. Halpern, 247 Minn. 80, 76 N.W.2d 702, 704 (1956), Syllabus ¶ 5:
"In the absence of fraud, a valid judgment, decree, or as here an order which is the equivalent thereof, entered by agreement or consent, operates as res judicata to the same extent as if it had been rendered after contest and full hearing and is binding and conclusive upon the parties and those in privity with them."
We are satisfied that the issues raised by Logosz in his claim of setoff in the second action were actually decided and necessarily involved in the determination of the first action, commenced by Logosz. The first adjudication, by judgment entered upon the stipulation of the parties, which provided that the stipulation was with prejudice and upon the merits,[*] was therefore res judicata *665 as to the issues raised by the claim of setoff in the second action.
The cases cited by Logosz are not in point or not persuasive. Robertson Lbr. Co. v. Progressive Contractors, Inc., 160 N.W.2d 61 (N.D.1968), involved a dismissal for failure to state a claim, not a decision on the merits. In Yoho-Venner Motor Co. v. Anderson Motor Co., 113 Neb. 514, 204 N.W. 54 (1925), the stipulated dismissal was "without prejudice." In Mongeon v. Burkebile, 79 N.D. 234, 55 N.W.2d 445 (1952), there was a question (not present in the case before us) of the authority of the attorney to act for the client in dismissing the case, and we recognized the general rules as to the effect of dismissal with prejudice and the res judicata effect of judgments entered upon stipulation. And in Knutson v. Ekren, supra, we found that the issues involved in the prior action were not determinative of those raised in the second action.

II. PLEADING AFFIRMATIVE DEFENSE
As we interpret the stipulation quoted in the footnote, supra, and the judgment entered in accordance with it, it has been conclusively adjudicated that Rugby Milling did not convert the grain of Logosz. It is not disputed that Logosz signed a note promising to pay Rugby Milling the sum of $6,657.79, due October 26, 1974. When sued upon that note, Logosz answered alleging that the claim was exaggerated, excessive, and not truly representative of the indebtedness. The trial court held that this did not constitute an assertion of the defense of failure of consideration, which is an affirmative defense required by Rule 8(c), N.D.R. Civ.P., to be pleaded affirmatively, and by Rule 8(e), to be "simple, concise, and direct."
Rule 8(b), N.D.R.Civ.P., requires that "A party shall state in short and plain terms his defenses . . ." and Rule 8(f) requires courts to construe pleadings so as to do substantial justice.
The trial court had before it, when it made its ruling, affidavits and a deposition in which Logosz admitted that he signed the note in question voluntarily. He did not specifically deny signing the note in his pleadings, nor did he at any time deny that the note was supported by some consideration.
Under Section 41-03-37, N.D.C.C. (U.C.C. § 3-307),
"1. Unless specifically denied in the pleadings each signature on an instrument is admitted. . . .
"2. When signatures are admitted or established, production of the instrument entitles a holder to recover on it unless the defendant establishes a defense."
A prima facie case was therefore made out by Rugby Milling. See Loew v. Minasian, 361 Mass. 390, 280 N.E.2d 688 (1972); Center Bank v. Mid-Continent Meats, Inc., 194 Neb. 665, 234 N.W.2d 902 (1975).
We believe the trial court acted well within its range of discretion in holding that the affirmative defense of failure of consideration was not pleaded. Prestin v. Baumgartner, 47 Wis.2d 574, 177 N.W.2d 825 (1970); Center Bank v. Mid-Continent Meats, Inc., supra.
We also note in passing the existence of a serious question as to whether consideration for the note was required at all, in view of the fact that it was apparently given either in compromise or as a novation. See Section 41-03-45, N.D.C.C. (U.C.C. § 3-408), providing that ". . . no consideration is necessary for an instrument or obligation thereon given in payment of or as security for an antecedent obligation of any kind."
Logosz next argues that the trial judge erred in finding that no issue of fact remained. He contends that under Rule 12(h), N.D.R.Civ.P., his affirmative defense was not waived even if not pleaded, citing Reishus v. Implement Dealers Mutual Insurance Co., 118 N.W.2d 673 (N.D.1962). However, that case involved facts which, while they might have been pleaded as an affirmative defense, could also have been asserted as sufficient to show a failure of *666 the plaintiff to state a claim upon which relief could be granted. Under Rule 12(h)(2), N.D.R.Civ.P., the defense of failure to state a claim may be made in any pleading permitted or ordered under Rule 7(a), or by motion for judgment on the pleadings, or at the trial on the merits. However, Rugby Milling's complaint is not subject to the defense of failure to state a claim upon which relief can be granted. In an action on a note, such as the case before us, it is not necessary to allege consideration, which is implied; rather, in order to state a claim, it is sufficient to set out a copy of the note and the amount claimed to be due. In this case, Rugby Milling stated a legal claim, and therefore failure of consideration cannot be raised under Rule 12(h)(2), N.D.R. Civ.P., but must be pleaded as an affirmative defense under Rule 8, N.D.R.Civ.P.
Logosz next argues that even if this court finds that his affirmative defense was not well pleaded, it was improper for the trial court to grant Rugby Milling's motion for summary judgment in light of the possibility of amendment to the pleadings under Rule 15(b), N.D.R.Civ.P. Since no amendment was ever requested, the possibility of amendment was only hypothetical. If the mere possibility of amendment were to be considered by a trial court in deciding motions for summary judgment, successful invocations of summary judgment would be rare, and the purpose of Rule 56, N.D.R. Civ.P., to eliminate trials of actions in which there is no genuine issue of fact, would be subverted. The mere possibility that ingenuity of counsel might make possible the pleading of an issue of fact does not preclude the granting of a motion for summary judgment on the pleadings and evidence as they exist when the ruling is made. Dardis v. Eddy Brothers, 223 N.W.2d 674 (N.D.1974), cited by Logosz, is not contrary to this view. It involved an issue tried by consent and an amendment of the pleadings to conform to the evidence. The difference between that case and this one is clear.
Affirmed.
ERICKSTAD, C. J., and PAULSON and SAND, JJ., concur.
PEDERSON, Justice (dissenting).
Although I agree with the statements of the legal principles presented by Justice Vogel, I do not agree that we should permit Rule 56, N.D.R.Civ.P., to be utilized when there is some doubt, which arises from an inference from evidence before the court, that justice may not thereby be served.
The pertinent part of Rule 56(c), which is involved, provides:
"Judgment shall be rendered forthwith if the pleadings, depositions, answers to interrogatories, and admissions on file, together with the affidavits, if any, show that there is no genuine issue as to any material fact and that any party is entitled to a judgment as a matter of law." [Emphasis added.]
In Farmers Elevator Company v. David, 234 N.W.2d 26, 29 (N.D.1975), we said:
"`However, under this rule a motion for summary judgment will be granted only if, after taking the view of the evidence most favorable to the party against whom the summary judgment is sought, it appears there is no genuine issue as to any material fact and that the party seeking the summary judgment is entitled to it as a matter of law.'"
Giving Logosz the benefit of all favorable inferences which can be reasonably drawn from statements made by him when his deposition was taken  even though it appears that he has much difficulty in articulating his position and has some obvious misconceptions of the law  there appears to be a fact dispute. It is possible that if the matter was presented at a full trial and Logosz was fully examined by his counsel, the trier of the facts might believe that the amount of Logosz's liability is not as great as Rugby Milling Company alleges. The mixed-up transactions between these two parties may never be satisfactorily explained. To impose all of the consequences of the confusion upon Logosz without an opportunity for a trial does not appear to be just. See the discussion of inferences from *667 depositions in Mondy v. Gjesdal, 123 N.W.2d 33, 36 (N.D.1963).
NOTES
[*]  "IT IS HEREBY STIPULATED AND AGREED, by and between the parties hereto, by and through their undersigned attorneys, that

"1. The above entitled action shall be and is hereby in all things dismissed with prejudice and without costs with the further understanding that the promissory note asserted by the Defendant in this case may be made the subject of separate litigation against the Plaintiff for the collection thereof, and
"2. That the judge of the above entitled Court, upon the presentation of a duly executed copy of this Stipulation, may order a Judgment of Dismissal of the Plaintiff's Complaint in all things with prejudice and upon the merits and without costs without any other or further notice to any party hereto.
"Dated this 22nd day of March, 1976."
