This action was begun by appellants after this court had rendered a judgment adverse to appellant *501Mallory. Mallory v. Olympia, 75 Wash. 245, 134 Pac. 914.
Plaintiffs seek to recover the reasonable value of labor performed and material furnished to a local improvement district in the city of Olympia, popularly known as the Swan-town slough. The case reported in 75 Wash. 245, was a proceeding in mandamus. Plaintiff Mallory prosecuted that case in his own name. The record shows, and it is admitted by all sides, that Martin was a silent partner, and. that he has met the burden of financing the contract which Mallory assumed to carry out. The city has made substantially the same answer in this case as it made in the mandamus case. When this case came on for hearing, it was stipulated that the pleadings and testimony taken in the former case might be introduced as evidence, whereupon counsel for the city moved for a judgment upon the ground that the former judgment was res judicata of all claims and demands that might be made by the plaintiffs. The court was of that opinion, and a judgment dismissing the action was entered.
It is not disputed that an action prosecuted upon an express contract will not bar an action upon quantum meruit. Thayer v. Harbican, 70 Wash. 278, 126 Pac. 625; Egbers v. Fischer, 73 Wash. 308, 131 Pac. 1128; Buddress v. Schafer, 12 Wash. 310, 41 Pac. 43. This upon the theory that a party is not put to the hazard of invoicing every possible remedy when seeking redress, nor suffer dismissal without remedy because he has invoked one which cannot be sustained in law. 15 Cyc. 262.
In determining whether the plaintiffs are concluded by the former action, we must look to the character of the action, the issue joined, and the judgment entered. Stripped of all verbiage and fine distinctions, and treating the mandamus proceedings as a civil action under the statute (State ex rel. Brown v. McQuade, 36 Wash. 579, 79 Pac. 207) the former proceeding was an action upon an express contract, to which the city tendered two issues, first, that the contract had not been performed according to its terms, and second, that, *502under the terms of the contract, the city had a right to take the work over at any time it might decide that it was not being done properly and finish it at the cost of the contractor and his bondsmen. When the case came on for trial, the court made no findings, nor were any invited, as to the amount due on the contract and the amount that might be properly set off against the contract price, but entered a judgment holding that Mallory had been guilty of fraud and that he had abandoned his contract. For these reasons, and these alone the action was dismissed. The real controversy so far as an issue was tendered touching the amount due for labor or material honestly and actually furnished, was not passed upon by the court.
Res judicata is, “a matter adjudged, a thing judicially acted upon or decided, a thing or matter settled by judicial decision.” 34 Cyc. 1666.
“A fact or question which was actually and directly in issue in a former suit, and was there judicially, passed upon and determined by a domestic court of competent jurisdiction.” 23 Cyc. 1215.
Can it be said that anything that is urged in this case was settled or decided by the court in the other case? The only possible theory that can be advanced against the right of appellants to maintain this action is that the judgment is conclusive of all things decided, or which might have been decided, in the former case. We have shown that the real issue between the parties was not decided, nor can it be held that it might have been decided. The plea of abandonment was in the nature of a plea in bar. When the court found that there had been an express contract and that it had been wilfully abandoned, the legal conclusion followed that a recovery could not be had upon the express contract. Therefore, the question of quantum meruit could not have been decided in the former action. The city asked no findings upon its present theory of the case, but was content with all that the law gave it, a judgment of dismissal. The merits of *503the case, either upon express contract or implied contract, were not “judicially passed upon and determined.” Consequently, it cannot be said that the merit of the case and any possible issue joined inhered in the judgment because it might have been passed on. Our decision upon the appeal in the former case is drawn upon the theory that the finding of abandonment was a bar to a judgment upon an express contract. We there said:
“When, therefore, the appellant persisted in following his own plan and ignoring that of the city engineer, he in law wilfully and fraudulently violated his contract, and cannot make it the basis for now insisting that the city make him the payments specified to be paid him upon the completion of the contract.” Mallory v. Olympia, supra.
We can find nothing in the law or in the record in this case that would bar an inquiry or prevent a recovery upon an action for quantum meruit. It is not denied that the appellants furnished labor and material of great value to the improvement district and which it is using in the exercise of its public functions. It may be admitted that the city has not received that for which it contracted, but it has received that which, by the exercise of its privileges under the contract, it has made to conform to its demands and for which it should pay a sum equal to its reasonable worth and value.
In determining whether the former judgment is res judicata we are not limited to an inspection of the judgment alone, for the parties have saved all legal questions as to the power of a court to go beyond the judgment, by stipulating that we may consider the pleadings as well as the judgment in the former case.
The words “the plaintiff wilfully abandoned his work under said contract and wholly failed to complete said contract in accordance with the plans and specifications and to the satisfaction of the city engineer,” considered in the light of the pleadings, make it plain that the issue before the court was whether or not the contract had been completed according *504to the plan. The contractor said it had. The engineer said it had not. We have no right to say, nor had the court in the former case, under the pleadings, the right to say, that there was a wilful abandonment. There was a dispute as to whether the work had been completed, and nothing more. A fault in this case from the beginning has been that, upon the hearing, it appeared by the testimony of the city engineer that Mallory had offered him a sum of money if he would approve the work. From this an inference of fraud has been drawn and allowed to run through the whole case, whereas, if it is true in fact, it occurred after the work had been done and is evidentiary matter going only to the credibility of the witness. Whether the conti-act was in fact performed according to the plans and specifications is a matter entirely separate and apart.
In Buddress v. Schafer, supra, it is said:
“To determine whether a former judgment is a bar to a subsequent action, it is necessary to inquire whether the same evidence would have maintained both of such actions.”
It is unnecessary to multiply authorities. This principle is laid down by every text writer and sustained by all authority. It is the primary test of res judicata. Let us apply it.
In the first case, it was incumbent upon plaintiff to prove the execution of his contract and to testify that his work had been performed. This made a prima facie case. Defendant, on the other hand, must prove that the work had not been done to the satisfaction of the city and had been completed at a certain cost and damage to the city, so that a judgment for the contract price would be offset, under the terms of the contract, by the cost to the city of making the work consistent with the plans and specifications. The value of the goods and the labor that went into the work were not material to the issue.
In this case, applying the same test, the terms and conditions, the time and manner of payment, and all details of *505the contract are immaterial. When plaintiffs show that they have furnished materials and labor which the city has put to its uses and has not paid its reasonable value, they have made out a prima facie case. Neither does the defense rest in contract, but would go only to the value of the labor and material less the damages and expenditures the city had been put to in adapting that labor and material to its final use.
This court has endeavored to hold municipalities to the same standard of right and wrong that the law imposes upon individuals. Franklin County v. Carstens, 68 Wash. 176, 122 Pac. 999; Coliseum Inv. Co. v. King County, 72 Wash. 687, 131 Pac. 245; State ex rel. Maddaugh v. Ritter, 74 Wash. 649, 134 Pac. 492; Ettor v. Tacoma, 77 Wash. 267, 137 Pac. 820. In Green v. Okanogan County, 60 Wash. 309, 111 Pac. 226, it was sought to enjoin the execution of a contract on the ground that it had not been let in accordance with the requirements of the statute. The court found that the controlling statutes were in fact violated and that the contract was void. Certainly a contract substantially performed, although held to be abandoned, stands upon no lower plane than a void contract. Yet, notwithstanding, we said:
“This court has adopted the more equitable doctrine of allowing the parties, where the contract if entered into in conformity with the statutes would not have been unlawful, to retain from the moneys received by them a sum equivalent to the reasonable value of the property the county acquires and retains in virtue of the execution of the void contract. . . . So in this case, since the county has accepted and made use of the bridge, it is liable to the builders for its reasonable value.”
We take it that the trial judge rested his judgment upon the case of Hawkins v. Reber, 81 Wash. 79, 142 Pac. 432. In that case it is granted that a former suit upon an express contract is not a bar to a second suit upon quantum meruit for the same services when it takes different evidence *506to establish it. It was held that the case did not fall within the rule. The former judgment was held to be res judicata because the controversy turned on a question of fact, whether there had been a mutual and voluntary settlement of all differences and disputes between the parties. The court held in the first case that there had been, and the effect of our holding was that a party could not relitigate a question of fact which had been judicially passed upon and determined by casting his pleadings in a new habit; whereas, in this case no question of fact has been determined other than the fact of abandonment, from which the court drew the legal conclusion that the action should be dismissed. Appellants are bound to accept that judgment, but they are not precluded, under the authorities and the fundamental principles of the law, from asking a court of competent jurisdiction to try the merit of the case presented.
It may be that Mallory did all that is claimed; that he did not follow the directions of the city engineer as they were given from day to day, and that he offered a bribe to the city engineer if he would approve the work; but it ill becomes a city to appeal to that fact to justify a taking of that for which it is rendering no recompense to the one whose money has gone to pay for the improvement and who is innocent of all wrong. Such a course is not justified by reference to any provision of the contract, nor can it be sustained by reference to any principle of the common law or equity. It should not be urged by man or municipality, nor should it be tolerated in a court of law.
It is further contended that, the court having found that the plaintiff abandoned his contract the plaintiffs cannot recover upon the theory of substantial performance. Many authorities are cited to sustain this rule, and it may be that no cases can be found where the doctrine of substantial compliance has been applied where there was an intentional and fraudulent failure to comply with the terms of the contract. The fault in this reasoning is that plaintiffs are not seeking *507to recover upon the theory of a substantial performance of a contract or upon a contract at all. As we have shown, there was no real question of abandonment in the full sense of that word, but a question of whether the work had been performed. But granting that there was an abandonment and that the city can raise the question of substantial performance, it is in no better position. We must look to the record in this case for the premise to sustain the applicable law, and when we do, we find this case is distinguished from all the cases relied on by counsel as well as the ultimate holding in Mortimer v. Dirks, 57 Wash. 402, 107 Pac. 184. If there had been no contract, or if the contract were silent as to the procedure in the event of a dispute over the fact of performance, we could admit that there could be no recovery where the contractor had been guilty of fraud in the prosecution of his work or had abandoned his contract. The city cannot plead or urge in this court the doctrine of substantial performance without pleading and relying on the contract.
The court, in the case of Mortimer v. Dirks, says of the rule allowing a recovery where the contract has been substantially performed,
“But such a rule, being founded in equity, is for the benefit of those who do equity, and it cannot be invoked by those who wilfully and intentionally violate and breach their contracts.”
The contract of the city to pay for the work necessary to make it conform to its idea of the plans and charge it against the contractor and his bondsmen is as sacred and binding as was the contract of the contractor to do the work according to the plans and specifications. In the Mortimer case, the equities were upon one side. In this case, there are equities upon both sides. The equities are equal and the law should prevail. The city should not be allowed to take labor and property upon the theory of moral wrong practiced by the contractor, while it is repudiating an express contract to do the work in its own way and charge the cost and no *508more against the contract price, or, if this action prevails, against the reasonable value of the labor and material.
The judgment of the lower court should be reversed, with instructions to take testimony as to the reasonable value of the labor and material, subject to all lawful offsets, so that an assessment can be made against the improvement district according to benefits to pay the amount due.
Crow, C. J., Gose, and Parker, JJ., concur.