delivered the opinion of the court:
This is a direct appeal from a decree of the circuit court of Du Page county, on a certificate of the trial judge that the validity of a municipal ordinance is involved, in- accordance with section 75(1) of the Civil Practice Act. Ill. Rev. Stat. 1943, chap. 110, par. 199.
The suit was brought by the city of Elmhurst, a municipal corporation, for an injunction to restrain appellee *197from operating an X-ray and diagnostic laboratory in a remodeled residence located in what was alleged to be a residential zone or district as zoned and classified by a zoning ordinance of said city. The complaint alleged that effective January 1, 1941, and thereafter, there was in force in said city, a zoning ordinance, by section 3 of which the district in which the property was located was restricted to single-family dwellings and, with certain limitations, to churches and religious temples, schools, colleges and libraries, and, as to the land only, to farming and truck gardening. It was further alleged that appellee was a licensed physician; that prior to 1942, he had conducted an X-ray and diagnostic laboratory in another part of the city which was zoned for commercial uses; that in 1941 he remodeled and made extensive changes in the residence building involved, installed an X-ray, therapy and fluoroscope machines, and other equipment for use in an X-ray and diagnostic laboratory; that he had vacated the premises formerly occupied by him and transferred such machines and laboratory and laboratory equipment, and had installed the same in the basement of the property in question; that the primary use to which he was devoting said property was a business purpose, namely, an X-ray and diagnostic laboratory; that such use was in violation of section 3 of the zoning ordinance. It was further alleged that on February 3, 1943, appellant caused a notice to be served on appellee, demanding that he cease his violation of the zoning ordinance, but that he had continued to operate said business in said building, in violation of said ordinance. The prayer of the complaint was for an injunction restraining the defendant from using the premises for an X-ray and diagnostic laboratory, and from the use of the same for any purpose which would constitute a violation of the zoning ordinance.
Appellee filed a motion to dismiss the complaint on the grounds that the complaint was substantially insufficient in *198law and equity; that the suit was barred by a prior judgment, and that the zoning ordinance was unreasonable and unlawful, and imposed unconstitutional restrictions upon appellee’s use of the property; that it operated to unlawfully deprive him of the use of his property, in violation of the constitution of this State and of the United States. An affidavit was attached to the motion in accordance with section 48(e) of the Civil Practice Act. In that affidavit, appellee set forth that the present proceeding was barred by an order and judgment for a writ of mandamus entered in a certain cause in the circuit court of Du Page county entitled Roy Kegerreis v. Wm. Hanebuth, Superintendent of Building Construction for the city of Elmhurst. This former proceeding will be hereafter referred to as the mandamus’ suit. The affidavit set out at length the complaint for a writ of mandamus, the answer of the defendant, the' motion of the plaintiff to strike the answer, the order of the court sustaining the motion, and the final judgment of the court awarding the writ of mandamus, which was entered on September 16, 1941. By the complaint in the mandamus suit, .the plaintiff therein, who is the defendant in the present suit and appellee here, prayed for a writ of mandamus against the superintendent of building construction of the city of Elmhurst compelling him to issue a permit for the installation of miscellaneous electrical apparatus and equipment in the property in question which would enable him to use the same as an X-ray and diagnostic laboratory.
To the complaint in the mandamus suit, the superintendent of building construction for the city of Elmhurst, the defendant named therein, filed an answer. By this answer it was alleged that the property in which the plaintiff sought a permit for the installation of the electrical machines, apparatus and equipment' was, under section 3 of the zoning ordinance, zoned only for residential purposes; that the plaintiff sought to obtain the permit to *199install the electrical machines, apparatus and equipment described in the complaint in order that he might use the property as a business building and conduct therein an X-ray and diagnostic laboratory which, it was alleged, would be a use prohibited, by section 3 of the zoning ordinance. That section of the zoning ordinance was set out in full in the answer. The plaintiff thereupon filed a motion to strike the answer. In this motion it was alleged, inter alia, that if the zoning ordinance be construed as tending to prohibit the alterations contemplated and the installation of the apparatus and equipment for which the permit was asked, or prohibited the plaintiff from conducting in said premises an X-ray and diagnostic laboratory, the ordinance was invalid. The motion to strike the answer was sustained by an order entered on August 18, 1941. By that order the defendant was given leave to file an amended answer within fifteen days. He declined to file any further answer. As already observed, on September 16, 1941, judgment was entered granting the writ of mandamus as prayed. No appeal was taken from that judgment. It will thus be seen that the validity of section 3 ofi the zoning ordinance was directly put in issue by the ■ answer in the mandamus proceeding and the motion to strike that answer. The effect of the order sustaining the motion to strike the answer and the judgment granting the writ of mandamus as prayed was to decide that issue in favor of the plaintiff in the mandamus case.
The order and judgment in the mandamus case having been properly pleaded as a bar to the action in this case, it becomes necessary to first determine the effect of the judgment in the mandamus suit upon the parties to this cause. It is contended by appellee that such judgment constitutes a bar to this action for the reason that an issue was made in the mandamus case as to the validity of section 3 of the zoning ordinance; that that issue was determined against the defendant, who was the superintendent *200of building construction for the city of Elmhurst; that while the city of Elmhurst was not a party to the mandamus case, the officer whose duty it was to enforce the zoning ordinance was the defendant, and that, for all practical purposes, the mandamus suit was a stiit against the city of Elmhurst; that the cause of action in the mandamus case and the cause of action-in this case is one and the same; that in determining the issue of whether the city official whose duty it was to enforce the zoning ordinance should be compelled to issue the permit, the validity of section 3 of the zoning ordinance was directly and necessarily involved in the former proceeding; that the decision of that issue was against such city official and is binding upon the city in this case.
Appellant contends that the judgment in the mandamus case is not an estoppel or bar to appellant’s cause of action in this case, because it alleges that there is no identity of the cause of action, the thing to be recovered, or the parties. It is contended that the mandamus suit involved only the question of the duty of the superintendent of building construction to issue the permit. It points out that, in this case, the action is for an injunction involving the use of the premises, after all permits have been issued and the alterations and installations and changes' have been made in the property, hence it is alleged that there is no identity of the causes of action. The determination of the question whether the judgment in the mandamus suit is an estoppel or a bar to appellant’s action in this case depends upon whether the cause of action or questions involved were determined by the former judgment and whether such former judgment is binding upon appellant in this case.
The rules applicable to the doctrine of former adjudication and estoppel by verdict have been clearly defined by this court in many cases. In Chicago Title and Trust Co. v, National Storage Co., 260 Ill. 485, we said: “There is *201a well defined distinction between a former judgment when it is relied on under plea of res judicata, and when it is pleaded by way of an estoppel by verdict upon some matter or fact which has been previously determined. In the former case it is necessary to support the defense that there should be an identity of parties and an identity of the cause of action with the one in which the defense is interposed. Such plea, in effect, says that the plaintiff has on a previous occasion brought an action against the defendant, or against one under whom the defendant claims, for the very same cause of action now alleged, in which said former action a judgment was given for the plaintiff or for the defendant, as may have been the case. (Bigelow on Estoppel, p. 27.) An estoppel by verdict is but another branch of the doctrine óf res judicata, and it rests upon the same principle of law, — that is, that a matter once litigated between parties to a final judgment in a court of competent jurisdiction cannot again be controverted. When this doctrine is applied to a single question or point arising in the course of litigation which has finally been adjudicated it is designated as an estoppel by verdict, and the same question or point cannot again be litigated between ' the same parties in the same or any other court at law or in chancery, and neither party, nor their privies, will be permitted to allege anything inconsistent with the finding upon that question.”
In Ohio National Life Ins. Co. v. Board of Education, 387 Ill. 159, the rule was announced as follows: “In applying the doctrine of estoppel by judgment, the distinction has been made between the finality of a judgment as a bar or estoppel where the second demand is for the same cause of action and between the same parties or their privies as the former action and those cases where the second action is between the same parties but upon a different claim or cause of action. If the action is of the former class, the judgment operates as an estoppel, not *202only as to every matter actually litigated in such action but extends to all grounds of recovery or defense which might have been presented. (Harding Co. v. Harding, 352 Ill. 417; Markley v. People ex rel. Kochersperger, 171 Ill. 260.) If the action between the same parties is of the latter class, that is, upon a claim or demand different from the one litigated in the first action, then the parties are estopped only as to those matters in issue or points controverted in the former action and the determination of which formed the basis of the judgment.”
When the second action is upon a different claim or demand, the judgment in the prior action operates as an estoppel only as to those matters in issue, or points in controversy, upon which the finding or a verdict was rendered in the former suit. Where some controlling fact or question material to the determination of both causes has been adjudicated in the former suit, by a court of competent jurisdiction, and the same fact or question is again at issue between the same parties, or their privies, its adjudication in the former suit, if properly pleaded, will be conclusive of the same question in the later suit. This is so, irrespective of the question whether the cause of action is the same in both suits. This is sometimes denominated as estoppel by verdict. Under this rule in order that the judgment in the first suit shall operate as an estoppel in the second suit, it must appear on the face of the record or be shown by extrinsic evidence that the precise question was raised and determined in the first suit. Where it is sought to apply the estoppel of a judgment rendered upon one cause of action to matters arising in a subsequent suit on a different cause of action, the inquiry must always be as to the points or questions actually litigated and determined in the former action, and not what questions might have been litigated and determined in such suit. It is only upon such questions that the former judgment is conclusive in the subsequent action. Chicago Theo*203logical Seminary v. People ex rel. Raymond, 189 Ill. 439; Wright v. Griffey, 147 Ill. 496.
The rule deducible from the decisions of this and other courts on the subject of former adjudication and estoppel by verdict is that if the first suit was between the same parties and involved the same cause of action, the judgment in the former suit is conclusive, not only as to all questions actually decided but as to all questions which might properly have been litigated and determined in that action. The second division of the rule is that even where the cause of action between the same parties in the former suit and the suit in which it is pleaded is not the same, the decision in the former suit on all questions actually decided is final, and estops the parties and all parties in privity with them from relitigating those questions in the subsequent proceedings.
The record in this case discloses that the former suit was brought against the superintendent of building construction of the city of Elmhurst, in his official capacity as such. The purpose of the suit was to coerce him to perform a corporate act of the city, vis: the issuance of a permit for the alteration of the building and the installation therein of the electrical apparatus and equipment suitable and required for the operation of an X-ray and diagnostic laboratory. He was not sued personally, but in his official capacity. The.suit could have been brought against the city and the same relief obtained, even though its superintendent of building construction was no't a party to the action. The purpose of the suit was to compel official corporate action by the superintendent of building construction, acting for and on behalf of the city. The record discloses that the superintendent of building construction, the defendant in the mandamus suit, appeared in that suit by the same attorney as the attorney appearing for appellant in the trial court, and in this court, in the present suit. The record does not show who employed the attorney or *204at whose expense the litigation was- conducted on behalf ■of the superintendent of building construction. Presumably the defense in that suit was under the direction and control, and was conducted at the expense, of the city. It being a suit to compel official corporate action by an officer of the city, it was, in effect, and to all intents and purposes, a suit against the city. The duty sought to be enforced, although it was to be discharged by an officer of the corporate body, acting for and-on behalf of the city, was, nevertheless, a corporate duty and the mandamus suit might, with equal propriety, have been brought against the corporation, alone. The effect and the ultimate result would have been precisely the same. People ex rel. Kelly v. Raymond, 186 Ill. 407.
It, therefore, clearly appears that the mandamus action, while in form a suit against an official of the city was, in effect, a suit against the city to compel the issuance of a permit through the corporate action of its officer, designated by section 20 of the zoning ordinance to be the superintendent of building construction. He was named in that section as the officer whose duty it was to enforce the zoning ordinance, in accordance with section 73-3 of the Revised Cities and Villages Act. (Ill. Rev. Stat. 1943, chap. 24, par. 73-3.) The effect was the same as though the suit had been brought against the municipality to com-, pel corporate action and not against its officer designated by the zoning ordinance as the department or branch of the city government charged with the enforcement of that ordinance.
In Ranson v. City of Pierre, 101 Fed. 665, a similar question was involved before the Circuit Court of Appeals for the Eighth Circuit. It was there said, “while-the mandamus suit was brought against the city treasurer, and not against the city by name, yet that officer was sued in his official capacity, and not as an individual. He did not defend the action for his personal benefit, but in right of *205the city, and, as custodian of its funds, to protect them against an illegal demand. The city permitted him to so defend, and the defense was doubtless made at the city’s expense. In that proceeding the city of Pierre was in reality challenging the validity of the bonds now in controversy in the name of its treasurer, and for its own benefit and advantage. If that suit had resulted differently, the city would not have been heard to say that it was not bound by the judgment, because it was not sued by its corporate name, but in the name of one of its officers.” In Bank of Kentucky v. Stone, 88 Fed. 383, a case before Circuit Judges Harlan, Taft and Lurton, all of whom after-wards served on the Supreme Court of the United States, the same rule was announced. The same conclusion was reached in Millikan v. LaFayette, 118 Ind. 323, 20 N. E. 847; Ashton v. Rochester, 133 N. Y. 187, 30 N. E. 695; and Fulton v. Pomeroy, 111 Wis. 663, 87 N. W. 831. In Ward v. Field Museum, 241 Ill. 496, this court announced and approved substantially the same rule. See, also, 34 C.J. p. 1028, sec. 1458. It seems to us that the conclusion is irresistible that the city of Elmhurst was the beneficial party defendant in the former suit and was in privity with its superintendent of building construction, who was named as defendant therein. This meets the requirement of the rule that the parties in the present action are the same as the parties to the mandamus suit or in privity with such parties.
This brings us to the question of the identity of the cause of action in the two suits. A cause of action consists of the right belonging to the plaintiff for some wrongful act or omission done by the defendant by which that right has been violated; the thing done or omitted to be done which confers the right upon the other to sue — that is, the act or wrong of the defendant against the plaintiff which caused a grievance for which the law gives a remedy. (Greene v. Fish Furniture Co. 272 Ill. 148; Vogrin v. *206American Steel and Wire Co. 263 Ill. 474; Lee v. Republic Iron and Steel Co. 241 Ill. 372; Mooney v. City of Chicago, 239 Ill. 414; Swift Co. v. Gaylord, 229 Ill. 330.) A cause of action includes every fact necessary for the plaintiff or the complainant to prove to entitle him to succeed and every fact which the defendant would have a right to traverse; the right to prosecute an action with effect. Geiger v. Merle, 360 Ill. 497; Walters v. City of Ottawa, 240 Ill. 259.
The right averred on the part of the plaintiff in the mandamus suit was the right to have issued- by the city, through its proper department or officer, a permit for the installation of the equipment in the property in question, suitable and necessary for the operation of an X-ray and diagnostic laboratory. The breach of the duty on the part of the defendant alleged was the refusal to issue such permit. The right and the breach alleged constituted the cause of action alleged by the plaintiff. In order to establish that right, it was incumbent upon the plaintiff to show that he was entitled to have the permit issued under the law and that the contemplated use of the property would not violate the provisions of any valid ordinance of the city. The alleged breach of the duty by the defendant involved every fact asserted in defense of the action. One of the facts alleged in defense was that the issuance of the permit and doing the things for which the permit was sought would violate section 3 of the zoning ordinance which prohibited the contemplated use of the property. To meet and obviate this defense, the plaintiff, by the motion to strike the answer, tendered as an issue the question óf the validity of section 3 of the zoning ordinance. The issue thus joined was included in the cause of action presented to the court for decision. The effect of the order of the court sustaining the motion and striking the answer was to hold that section 3 of the zoning ordinance did not lawfully prohibit the issuance of the permit and the con*207templated use of. the property. That section of the ordinance, if valid, did, in terms, expressly prohibit such use. If that section did not lawfully prohibit the issuance of the permit and the contemplated use of the property, it was only because it was not a valid ordinance. The order of the court, therefore, striking the answer was, in effect, a decision by the court that the ordinance was invalid.
The cause of action in the present proceedings is the right of the city to enjoin the defendant from using the same property for the purpose of conducting therein an X-ray and diagnostic laboratory. The breach of duty on the part of the defendant was his alleged wrongful use of the property involved, in violation of section 3 of the zoning ordinance, for that purpose. The right of plaintiff was dependent upon the validity of section 3 of the zoning ordinance. The breach of the defendant was also dependent upon the validity of that section. In defense of the action, the defendant filed a motion to dismiss the complaint. Among other grounds alleged in the motion to dismiss was that section 3 of the zoning ordinance, which was set up in the complaint and on which the action was based, was invalid. The issue as to the validity of section 3 of the zoning ordinance was thus joined on the complaint and the motion to dismiss the complaint.
This was the identical question involved upon the issues raised by the motion to strike the answer in the mandamus suit. In the present proceeding, in order for the plaintiff to succeed, it was necessary for it to show that section 3 of the zoning ordinance was valid. The right of the plaintiff sought to be enforced was based solely upon that section of the ordinance. The defense pleaded was the invalidity of the ordinance. The court, in the mandamus case, had determined that issue. The issue in both cases was the validity of section 3 of the zoning ordinance, as applied to the same property, involved in both suits. That question was determined in the mandamus suit adversely *208to the contentions of appellant in this suit. In this suit the appellant seeks to relitigate the question of the validity of the zoning ordinance. If that issue had been determined adversely to the plaintiff in the mandamus suit, the appellee here, we do not anticipate that anyone would contend that he could relitigate that question against the city in this suit, although it was not the • defendant named in the mandamus suit. For the same reason, if the city had been named as the defendant in the mandamus suit, no one' could successfully contend that the superintendent of building construction would be permitted, in a subsequent suit involving corporate action on his part, under the same ordinance of the city, to relitigate the question of the validity of the zoning ordinance.
The purpose of the doctrines of res judicata and estoppel by verdict is to prevent the relitigation, in a subsequent proceeding, of questions settled by a court of competent jurisdiction in a prior suit between the same parties or their privies. It seems to us that the record conclusively shows that there was identity of parties and cause of action in the two suits, and that the former judgment operates as a bar to the present suit. But, be that as it may, there can be no contention that the question of the validity of section 3 of the zoning ordinance was not directly put in issue and decided by the court in the mandamus suit. That identical question is put in issue by the pleadings in the present proceeding. By sustaining the motion to strike the answer in the mandamus suit in which one of the grounds alleged in the motion was the invalidity of section 3 of the zoning ordinance, and awarding the writ, the effect of that judgment was to hold that section invalid. It is immaterial that the court, in the order and judgment entered, did not expressly so hold,' or did not mention the validity or invalidity of the ordinance. The value of a plea of former adj.udication is not to be determined by the reasons which the court rendering the former *209judgment may have given for doing so. (Harmon v. Auditor of Public Accounts, 123 Ill. 122.) The fact that the court did decide, and the results of the decision, are the matters that are material. The reasons, if any, given by the court in arriving at the conclusion reached, are wholly immaterial. (Town of Lyons v. Cooledge, 89 Ill. 529.) It is our conclusion that the judgment in the mandamus suit constituted a complete bar to the present action. This makes it unnecessary to consider any other question involved in the case.
The decree of the circuit court of Du Page county is affirmed.
. rc Decree affirmed.
Mr. Justice Fulton took no part' in the consideration or decision of this case.