
20 Cal.2d 83 (1942)
J. LESTER MILLER, Appellant,
v.
J. M. McKINNON et al., Respondents.
S. F. No. 16023. 
Supreme Court of California. In Bank.  
Apr. 2, 1942.
 George F. Sharp for Appellant.
 Louis Oneal, Maurice J. Rankin, Duncan Oneal, Bohnett, Hill, Cottrell & Boccardo, Peckham & Peckham and C. C. Coolidge for Respondents.
 CARTER, J.
 Plaintiff, as a citizen resident and taxpayer of Santa Clara County, commenced in his name on behalf of the county, an action against a partnership doing business under the name of Nash Englehardt Silva Mfg. Co., and the members thereof, and certain county officers to recover money claimed by him to have been illegally expended by the county and received by the partnership. He also named the county as a defendant. He appeals from a judgment of dismissal entered after demurrers to his fourth amended complaint were sustained without leave to amend.
 Plaintiff's fourth amended complaint contains two counts. In the first count, which was directed against the partnership defendant, he alleged that he is a citizen resident and taxpayer of the county; that the county owned real property upon which was situated "certain buildings or structures and a rock quarry"; that as a part of the buildings and attached thereto were "bunkers, hoists, motors, conveyors, crushers, screens, electrical appliances and a steel tower"; that in June, 1934, the Board of Supervisors of Santa Clara County authorized one of their members, J. M. McKinnon, to obtain assistance from the State Emergency Relief Administration for a project of repair and alteration of said quarry; that plans and specifications were approved by the board for that project of "repairing bunkers, moving and repairing hoists, extending power line, repairing motor, making tunnel and foundation, constructing 140' X 32" conveyor and erecting new steel tower," the estimated cost of which was $15,119, the labor cost to be furnished by SERA constituting $8,130 thereof; that thereafter such work was commenced; that the board did not adopt a resolution authorizing the performance of the work, and no bids therefor were called for; that between *87 January 28, 1935, and January 13, 1936, there were issued warrants to the partnership defendant for a part of said work in the sum of $42,151.90; and that the District Attorney of Santa Clara County knew of all of these facts but refused to bring an action for the recovery of the money so expended. The prayer of said count is for judgment in the sum of $42,151.90 against the partnership defendant. Thus, in essence this cause of action is one by a taxpayer in his own name on behalf of the county to recover moneys illegally expended, the illegality consisting of the failure to advertise for bids on the work to be performed on behalf of the county."
 The second count adopts the foregoing allegations, and further alleges that the county purchasing agent, and quarry superintendent, some of the supervisors, and the partnership defendant conspired to do said work without calling for bids; that the bills of the partnership defendant that were paid were padded and included charges for labor and material in the sum of $17,847.68 which were never performed or furnished, all of which was known by the purchasing agent, superintendent of the quarry, the partnership defendant and supervisor McKinnon but was not known to the other supervisors who relied upon McKinnon's assurance that the claims were proper and voted to issue the warrants; that the district attorney with knowledge of those facts refused to take action to recover the money illegally expended.
 Separate special and general demurrers to the plaintiff's third amended complaint were filed by Allegrini, McKinnon, Flood, and the partnership defendant. In the order sustaining those demurrers, leave to amend was conditioned upon plaintiff's joining as defendants the supervisors of Santa Clara County who voted for the issuance of the warrants. Demurrers were likewise interposed to the fourth amended complaint, but it does not appear what ruling was made thereon except the recital in the judgment of dismissal that the demurrers were sustained on December 28, 1937. The judgment of dismissal is dated January 12, 1938.
 [1] Ordinarily, compliance with the terms of a statute requiring the letting of certain contracts by a public agency such as a municipal corporation or county by competitive bidding and the advertising for bids is mandatory with respect to those contracts coming within the terms of the statute; a contract made without compliance with the statute is void *88 and unenforceable as being in excess of the agency's power. This court stated in Los Angeles Dredging Co. v. Long Beach, 210 Cal. 348, 353 [291 P. 839, 71 A.L.R. 161], in considering a competitive bidding requirement:
 "Certain general principles have become well established with respect to municipal contracts, and a brief statement of these principles will serve to narrow the field of our inquiry here. The most important one is that contracts wholly beyond the powers of a municipality are void. They cannot be ratified; no estoppel to deny their validity can be invoked against the municipality; and ordinarily no recovery in quasi contract can be had for work performed under them. It is also settled that the mode of contracting, as prescribed by the municipal charter, is the measure of the power to contract; and a contract made in disregard of the prescribed mode is unenforceable." (See, also, Reams v. Cooley, 171 Cal. 150 [152 P. 293, Ann. Cas. 1917A, 1260]; Zottman v. San Francisco, 20 Cal. 96 [81 Am. Dec. 96]; Murphy v. Napa County, 20 Cal. 497; Jones v. Southern Pacific Co., 34 Cal.App. 629 [168 P. 586]; Matthews v. Town of Livermore, 156 Cal. 294 [104 P. 303]; Foxen v. City of Santa Barbara, 166 Cal. 77 [134 P. 1142]; Santa Cruz R. P. Co. v. Broderick, 113 Cal. 628 [45 P. 863]; City Improvement Co. v. Broderick, 125 Cal. 139 [57 P. 776]; Gamewell F. A. T. Co. v. Los Angeles, 45 Cal.App. 149 [187 P. 163]; Strauch v. San Mateo Junior College Dist., 104 Cal.App. 462 [286 P. 173]; Brown v. Bozeman, 138 Cal.App. 133 [32 P.2d 168]; Henry Cowell Lime & Cement Co. v. Williams, 182 Cal. 691 [189 P. 838].) And even though the person with whom the contract was made has supplied labor and materials in the performance of the contract and the public agency has received the benefits thereof, he has no right of action to recover in quantum meruit the reasonable value thereof. (Reams v. Cooley, supra; Zottman v. San Francisco, supra; Gamewell F. A. T. Co. v. Los Angeles, supra.) The competitive bidding requirement is founded upon a salutary public policy declared by the legislature to protect the taxpayers from fraud, corruption, and carelessness on the part of public officials and the waste and dissipation of public funds. This court stated in Reams v. Cooley, supra, at page 157:
 "It is urged in this case, as it invariably is in all such cases, that the application of this rule works a great hardship if *89 the school district may retain the benefit of the work of the contractor and be relieved of liability to compensate him therefor. But the provision of the law limiting the power of school boards to validly contract, except in a prescribed mode, proceeds from a consideration of public policy not peculiar to such boards, but adopted as the policy of the state with reference to inferior boards and public bodies, and it would be difficult to perceive what practical public benefit or result could accrue by legislative limitation or prohibition on the power of such bodies to contract if courts were to allow a recovery where the limitation or prohibition is disregarded. In fact, the plea of hardship urged here was answered in the Zottman case by language as pertinent now as it was then, where the court said: 'It may sometimes seem a hardship upon a contractor that all compensation for work done, etc., should be denied him; but it should be remembered that he, no less than the officers of the corporation, when he deals in a matter expressly provided for in the charter, is bound to see to it that the charter is complied with. If he neglect this, or choose to take the hazard, he is a mere volunteer, and suffers only what he ought to have anticipated. If the statute forbids the contract which he has made, he knows it, or ought to know it, before he places his money or services at hazard.' " [2] Persons dealing with the public agency are presumed to know the law with respect to the requirement of competitive bidding and act at their peril. (See cases cited supra.) [3] With the principles being as above stated, it inescapably follows that a right of action exists to recover moneys paid to a contractor for work and materials furnished the public agency where they were furnished in contravention of a statute requiring competitive bidding. If, as we have seen, the contract is absolutely void as being in excess of the agency's power, the contractor acts at his peril, and he cannot recover payment for the work performed, it necessarily follows that any payments made to him for the work are illegally made and may be recovered. If that were not true the competitive bidding requirement would be completely nullified because the agency could have the work done, pay the charges therefor, and the taxpayers would be helpless to compel observance of the law. The only event preventing that result in any case would be whether some taxpayer acted soon enough to forestall the payment by injunction proceedings. The effective *90 operation and enforcement of the public policy declared in the statute cannot be dependent upon such an uncertainty. The temptation on the part of officials and the persons contracting with the agency desiring to evade the law would be to act quickly and secretly in order that the taxpayers would be caught off guard. Such a condition is manifestly undesirable.
 It has been held that recovery may be had of payments made to a public official who was interested in the transaction for the furnishing of supplies for which the payments were made. (County of Shasta v. Moody, 90 Cal.App. 519 [265 P. 1032].)
 [4] The case of Sacramento County v. Southern Pacific Co., 127 Cal. 217 [59 P. 568, 825], denies the right of recovery from the contractor, but as pointed out in the dissenting opinion in that case and under the foregoing principles, such a rule cannot stand; it ignores those principles and must be overruled. It is founded wholly on estoppel which it assumes to be available against a municipality. That assumption is incorrect where compliance has not been had with the statute, which is the measure of the power. (See Hall v. City of Los Angeles, 19 Cal.2d 198 [120 P.2d 13]; Kline v. San Francisco U. School Dist., 40 Cal.App.2d 174 [104 P.2d 661, 105 P.2d 362]; cases cited supra.) For the same reasons the apparent holding contrary to the views herein expressed in Higgins v. San Diego Water Co., 118 Cal. 524 [45 P. 824, 50 P. 670]; Contra Costa Water Co. v. Breed, 139 Cal. 432 [73 P. 189]; Warren Bros. Co. v. Boyle, 42 Cal.App. 246 [183 P. 706], must not prevail. Furthermore, the language in the Contra Costa Water Company case appears to be dictum. (See dissenting opinion, Beatty, C.J.) The same is true of Miller v. Boyle, 43 Cal.App. 39 [184 P. 421]. The case of McCormick L. Co. v. Highland S. Dist., 26 Cal.App. 641 [147 P. 1183], involved a situation where there was a compliance with the statutory requirements but they were merely insufficient. Under the complaint here involved no advertisement for bids was made in proper form, defective form, or any form. A similar comment is applicable to Clark v. Conley School District, 86 Cal.App. 527 [261 P. 723]. Some of those cases were strictly limited by Reams v. Cooley, supra, in which a contractor was not permitted to recover in quantum meruit for labor and materials furnished to a school district because *91 the contract was not let on competitive bids, where the court said at page 153:
 "Undoubtedly, a school board, like a municipal corporation, may, under some circumstances, be held liable upon an implied contract for benefits received by it, but this rule of implied liability is applied only in those cases where the board or municipality is given the general power to contract with reference to a subject matter and the express contract which it has assumed to enter into in pursuance of this general power is rendered invalid for some mere irregularity or some invalidity in the execution thereof; where the form or manner of entering into a contract is not violative of any statutory restriction upon the general power of the governing body to contract nor violative of public policy. In the absence of such restriction on the mode or manner of contracting the same general rule applies to such inferior political bodies as to individuals and the former will be held responsible on an implied contract for the payment of benefits it receives under an illegal express contract not prohibited by law. This is the effect of the cases cited by appellant and relied on by him, notably Higgins v. San Diego Water Co., 118 Cal. 524 [45 P. 824, 50 P. 670]; Sacramento v. Southern Pacific Co., 127 Cal. 217 [59 P. 568, 825], and Contra Costa Water Co. v. Breed, 139 Cal. 432, [73 P. 189]. But while the doctrine of implied liability applies where general power to contract on a subject exists and the form or manner of doing so is not expressly provided by charter or statute, the decided weight of authority is to the effect that when by statute the power of the board or municipality to make a contract is limited to a certain prescribed method of doing so and any other method of doing it is expressly or impliedly prohibited, no implied liability can arise for benefits received under a contract made in violation of the particularly prescribed statutory mode. Under such circumstances the express contract attempted to be made is not invalid merely by reason of some irregularity or some invalidity in the exercise of a general power to contract, but the contract is void because the statute prescribes the only method in which a valid contract can be made, and the adoption of the prescribed mode is a jurisdictional prerequisite to the exercise of the power to contract at all and can be exercised in no other manner so as to incur any liability on the part of the municipality. Where the statute prescribes *92 the only mode by which the power to contract shall be exercised the mode is the measure of the power. A contract made otherwise than as so prescribed is not binding or obligatory as a contract and the doctrine of implied liability has no application in such cases."
 The statute with respect to competitive bids here involved is section 4041.18 of the Political Code. It provides in part:
 "Under such limitations and restrictions as are prescribed by law, and in addition to jurisdiction and powers otherwise conferred, the board of supervisors, in their respective counties, shall have the jurisdiction and powers to construct or lease, build or rebuild, furnish or refurnish or repair hospital and almshouse, courthouse, jail, historical museum, aquarium, county free library building, branch library building, art gallery, art institute, exposition building or buildings for exhibiting and advertising farming, mining, manufacturing, live stock raising, and other resources of the county, stadium and such other public buildings as may be necessary to carry out the work of the county government, and to provide all necessary officers, employees, attendants, and supplies for the proper maintenance of the same. ..."
 "Whenever the cost of construction of any wharf, chute, or other shipping facilities, or of any hospital, almshouse, courthouse, jail, historical museum, aquarium, county free library building, branch library building, art gallery, art institute, exposition building or buildings, stadium or other public buildings, or the cost of any repairs thereto or furnishing thereof shall exceed the sum of five hundred dollars, such work shall be done by contract, and any contract therefor shall be void unless the same shall be let as hereinafter provided."
 "The board of supervisors shall adopt plans and specifications, strain sheets and working details therefor, and must advertise for bids for the performance of the said work in a newspaper of general circulation published in the county. ..."
 "Provided, however, that in counties employing a purchasing agent, furnishings, materials and supplies used in the work mentioned in this subdivision costing not more than two thousand dollars, may be purchased by said purchasing agent in accordance with the provisions of section 4041.13 of this code without the formality of obtaining bids, letting contracts, preparing specifications and doing the other things required by this section for purchases costing more than five hundred dollars." *93
 [5a] From the allegations in the fourth amended complaint with regard to the work performed, it appears that the county of Santa Clara owns a parcel of real property and that there is situated thereon and "attached thereto, as part of said real property, certain buildings or structures and a rock quarry; that as a part of said buildings or structures and attached thereto there were bunkers, hoists, motors, conveyors, crushers, screens, electrical appliances and a steel tower; that said buildings or structures at all times herein mentioned were used to operate said quarry and extract rock therefrom"; that it was determined by the board of supervisors that the repairs and alterations to said quarry were necessary and plans and specifications therefor were filed and "that said plans and specifications designated said repairs and alterations as one project or one job, including 'repairing bunkers, moving and repairing hoists, extending power line, repairing motor, making tunnel and foundation, constructing 140' x 32" conveyor and erecting new steel tower'. That said plans and specifications of said County Surveyor included an estimate of the total cost of said job or project at Fifteen Thousand One Hundred Nineteen Dollars ($15,119.00), Eight Thousand One Hundred Thirty Dollars ($8,130.00) thereof estimated as labor to be furnished by SERA and the balance covering materials to be furnished by the County of Santa Clara". We believe those allegations are sufficient to bring the work performed within the terms of section 4041.18 of the Political Code; the only item that might possibly be excluded would be the "repairing motor". The terms "other public buildings, or the cost of any repairs thereto or furnishing thereof" appearing in section 4041.18 are sufficiently comprehensive to include the bunkers, tunnel, hoists, power line, conveyor and tower. [6] Plaintiff alleged that the various items were attached to and a part of the structures and buildings at the rock quarry. The term "public buildings" is obviously not limited to places where the public assembles. A jail would clearly be a public building; yet it is not ordinarily a place of public assemblies. (See Swasey v. County of Shasta, 141 Cal. 392 [74 P. 1031].) For illustration, it has been held that the term building includes a sandhopper (Wilbur v. City of Newton, 307 Mass. 111 [29 N.E. (2d) 689]); and a spur track (Saulsberry v. North American Refractories Co., 278 Ky. 808 [129 S.W. (2d) 525]); and that the terms "structures" *94 and "public buildings" are synonymous (Saulsberry v. North American Refractories Co., supra.) There is no policy of law which requires that a restricted or narrow meaning be given to the term building as here used in the statute. The manifest policy of the law is to require competitive bidding when the county engages in the construction or repair of improvements costing more than the named amount."
 [5b] The fact that a county's authority for acquiring and operating a quarry is particularly set forth in a separate code section (Political Code, sec. 4041e) is of little significance in determining the scope of section 4041.18. Section 4041e does not purport to touch upon the subject of the manner of construction of quarry facilities, and it may be said of some of the other structures specifically mentioned by name in section 4041.18, that they find specific authorization in other sections or statutes. Sections 4041.18 and 4041e must be construed together and the former is a limitation on the latter. (See Matthews v. Town of Livermore, supra.) [7] Nor may it be successfully urged that by reason of the listing of various public buildings, the words "other public buildings" refer only to structures of the character in the preceding list, because that list includes a wide variety of works with no common characteristic such as a "chute and wharf" as compared with a library.
 [8] Defendants assert that there were numerous items furnished over a period of a year and that one furnishing various items of labor or material cannot be expected to ascertain each time whether the items are a part of one project and thus requiring bids. It is true that it is alleged that the work was done over a period of a year, but it is also alleged: "That said plans and specifications designated said repairs and alterations as one project or one job." (Emphasis added.) The allegations hereinbefore quoted are sufficient to state a case coming within the terms of section 4041.18 of the Political Code. Defendants are not foreclosed from furnishing proof that the labor and materials furnished by them did not in fact come within the purview of that section. It must be true that the salutary public policy declared by that section may not be thwarted by the device of splitting a job into many items, each calling for an expenditure below the prescribed amount in excess of which competitive bidding is required.
 [9a] As we have seen, the demurrer to the first count in *95 the complaint was general and also claimed lack of legal capacity on plaintiff's part to maintain the action. It is defendants' position that plaintiff's first cause of action, that is, the action to recover the money paid to the partnership on the ground that the payment was illegal as there was no compliance with the competitive bidding requirement, is founded upon a liability created by section 4005b of the Political Code, and the action thereunder must be prosecuted in the name of the county. Plaintiff alleged that he is a resident citizen and taxpayer of Santa Clara County; that the action is brought on behalf of the county, and that the district attorney of the county has refused to bring it. He named the county as a party defendant. Such procedure is proper. (See Osburn v. Stone, 170 Cal. 480, 482 [150 P. 367].) Section 4005b provides:
 "Whenever any board of supervisors shall, without authority of law, order any money paid as salary, fees, or for any other purposes, and such money shall have been actually paid; or whenever any county officer has drawn any warrant or warrants in his own favor, or in favor of any other person, without being authorized by the board of supervisors, or by the law, and the same shall have been paid, the district attorney of such county is hereby empowered, and it is hereby made his imperative duty, to institute suit, in the name of the county, against such person or persons, to recover the money so paid, and twenty per cent damages for the use thereof; and no order of the board of supervisors therefor shall be necessary to maintain such suit. When the money has not been paid on such order or warrants, it is hereby made the imperative duty of the district attorney of such county, upon receiving notice thereof, to commence suit, in the name of the county, to restrain the payment of the same; and no order of the board of supervisors shall be necessary in order to maintain such suit." Section 526a of the Code of Civil Procedure authorizes a citizen resident to bring an action against a county officer to restrain the illegal expenditure of money. It has been intimated either directly or indirectly that section 4005b in effect creates a cause of action for money illegally expended against the person to whom paid. (County of Calaveras v. Poe, 167 Cal. 519 [140 P. 23]; County of Santa Barbara v. Janssens, 177 Cal. 114 [169 P. 1025, L.R.A. 1918C, 558]; County of Santa Barbara v. Rucker, 35 Cal.App. 676 [170 P. 860]; Burr *96 v. Board of Supervisors, 96 Cal. 210 [31 P. 38]; Hansen v. Carr, 73 Cal.App. 511 [238 P. 1048]; County of Shasta v. Moody, supra; County of Marin v. Messner, 44 Cal.App.2d 577 [112 P.2d 731]. Contra dictum, Miller v. City of Martinez, 28 Cal.App.2d 364 [82 P.2d 519].) It cannot be doubted that unless some substantive right is established by section 4005b then there is no basis for the recovery of the 20 per cent penalty in addition to the money illegally received, provision for which is made in that section. We believe that it must be conceded that that section at least recognizes the existence of such a cause of action. As heretofore pointed out, however, a cause of action exists to recover from the person receiving the money illegally paid, independent of any statute, and it is also clear that the action may be prosecuted by a taxpayer in his name on behalf of the public agency. (See Mock v. City of Santa Rosa, 126 Cal. 330 [58 P. 826]; Osburn v. Stone, supra; Hansen v. Carr, supra; Newton v. Brodie, 107 Cal.App. 512 [290 P. 1058]; Briare v. Matthews, 202 Cal. 1 [258 P. 939].) [10] Where a statute makes it the imperative duty of a specified officer to maintain actions to recover money illegally expended by county officers, there must be a showing that such officer refuses to or for some reason cannot act before a taxpayer's suit is proper. (Hansen v. Carr, supra.) There is a statute here imposing such duty on the district attorney (Pol. Code, sec. 4005b.) The plaintiff alleged that the district attorney refused to act. While it is true that plaintiff states in his brief that his action is based upon section 4005b, nevertheless, it follows from the foregoing that plaintiff has adequately stated a cause of action in his first count against the partnership for the recovery of the sums illegally expended which arose independent of statute. It was not therefore necessary that such action be prosecuted in the name of the county because it is not affected by the statute.
 [9b] However, if plaintiff is to recover the penalty of 20 per cent in addition to the money received by defendant partnership, he must necessarily rely upon section 4005b, assuming a substantive right of action is created by that section. Even so, the demurrer, both general and for defect of parties plaintiff was improperly sustained. We see no valid reason why the action must be brought in the name of the county. Section 4005b merely requires the district attorney to bring the action in the name of the county when he prosecutes it. *97 Naturally, he would bring the action in the county's name as attorney for the county. When he is not prosecuting the action because of his refusal to do so, the requirement that it be in the name of the county is no longer of any consequence. The action then is on behalf of the county by a taxpayer who in reality is representing the taxpayers generally. He in fact has no authority to sue in the name of the county. The case of Gray v. White, 5 Cal.App.2d 463 [43 P.2d 318], is not contrary to this view. There the action was by a taxpayer in his name against the supervisors and other officers of a county to recover money illegally expended. The court held a demurrer to the complaint properly sustained because plaintiff failed to allege the refusal on the part of the district attorney to bring the action. The statements there made with reference to the necessity of the action being in the name of the county and that the county was improperly joined as defendant are dicta.
 [11] Defendants claim that the complaint is uncertain because it cannot be ascertained that the work and labor furnished by defendant partnership was a part of one job. We have heretofore quoted the allegation to the effect that the repairs and alteration to the rock quarry buildings was one job. It therefore appears on the face of the complaint that competitive bidding was necessary. The complaint is sufficiently certain to meet the requirement of a pleading of this character.
 [12] In regard to the second cause of action, it is plaintiff's position that the gravamen thereof is the same as the first cause of action, that is, the failure to call for bids, and that the other allegations with respect to padding of bids, failure to supply the materials claimed, and knowingly causing the illegal payments to be made, were made to establish the participation of the defendants supervisor J. M. McKinnon, purchasing agent Emma Allegrini, and E. P. Flood, the superintendent of the county quarry, in a conspiracy to make the illegal expenditures. However, it should be mentioned that plaintiff prays for only $17,847.68 against the above defendants, the amount of claimed excessive payment for the material. The court ruled with regard to the demurrer to the third amended complaint as follows:
 "IT IS HEREBY ORDERED That said demurrers, and each of them, be sustained and plaintiff granted fifteen (15) *98 days from date hereof to file an amended complaint, on condition that in said amended complaint he join as defendants all members of the Board of Supervisors of Santa Clara County who voted in favor of any motion to issue any of the County Warrants referred to in plaintiff's amended complaint."
 "In the event that plaintiff shall fail to join as defendants herein all Supervisors of Santa Clara County who voted for any of said warrants by filing a further amended complaint within said period of fifteen (15) days,"
 "IT IS ORDERED that said demurrers, and each of them, be sustained without leave to amend." (Emphasis added.) Thereafter, plaintiff filed his fourth amended complaint in which he named as defendants, Hecker, Ayer and Cooley, they being three supervisors in addition to supervisor McKinnon theretofore named as defendant; the fifth supervisor was not named. Plaintiff alleged in his fourth amended complaint "that all of the members of the Board of Supervisors named herein as defendants voted for the issuance of each warrant"; the named defendants were the above-mentioned four supervisors; the warrants were for the sum of $42,151.90 paid to defendant partnership. One of the grounds of the demurrer to the fourth amended complaint was a defect of parties in that all of the members of the board of supervisors were not made defendants; the demurrer also specified all the grounds theretofore stated in the former demurrers to the third amended complaint. As far as appears from the record, the court made no order in regard to the demurrer to the fourth amended complaint. The only document with reference thereto is the judgment dismissing the action dated January 12, 1938, in which it is recited that defendants "having appeared and demurred to plaintiff's fourth amended complaint herein and the issue of law therefrom arising having been duly submitted to the court for its decision and the court being fully advised in the premises and having, by its order duly given and made on the 28th day of December, 1937, sustained the demurrer of said defendants to plaintiff's said fourth amended complaint without leave to amend the same." (Emphasis added.) Regardless of whether the requirement that plaintiff name all of the supervisors who voted for the issuance of the warrants, as defendants, set forth in the order sustaining the demurrers to the third amended complaint, was proper as a condition *99 to plaintiff's right to amend, it seems that the plaintiff substantially complied with that condition. He alleged that the four supervisors named voted for the issuance of the warrants. The fact that he had alleged in the third amended complaint that all of the supervisors voted for the warrants does not mitigate against this allegation inasmuch as we must look at the final allegation in the last amended complaint. Therefore defendants cannot successfully assert that plaintiff failed to comply with the condition imposed by the court on his right to amend.
 [13] However, inasmuch as the demurrer to the fourth amended complaint, raised the issue of the necessity of all the supervisors being named as defendants, and the demurrer was apparently sustained on all grounds, it becomes necessary to consider whether all the members of the board were necessary parties. We have seen that the first cause of action was directed at defendant partnership, the party who received the payments from the county, to recover the money illegally paid to it. It has been held that a demurrer for defect of parties, that is, that parties have not been joined, should be sustained only if the parties are necessary parties as distinguished from proper parties. (Tregear v. Etiwanda Water Co., 76 Cal. 537 [18 P. 658, 9 Am.St.Rep. 245]; De Leonis v. Hammel, 1 Cal.App. 390 [82 P. 349].) The court may, of course, order proper parties to be brought in if expedient for a complete determination of the controversy. (Code Civ. Proc., sec. 389.) It has been said that the proper procedure to follow when a demurrer for defect of necessary parties is meritorious, is to order the parties brought in rather than to sustain the demurrer. (Hughson v. Crane, 115 Cal. 404 [47 P. 120].) We have seen that plaintiff substantially complied with the order of the court to bring in the other supervisors who voted for the issuance of the warrants, if we treat the order sustaining the demurrer to the third amended complaint as embodying such order. No order other than that was made. In any event, all of the members of the board of supervisors are not necessary parties defendant in an action against such officers to recover funds illegally expended. An analogous situation exists in an action by stockholders to recover on behalf of a corporation from the directors thereof, corporate funds unlawfully diverted. In such a case all of the guilty members of the board of directors need not be named *100 defendants, their liability being joint and several. (Curtis v. Metcalf, 265 Fed. 293; Baker v. Baker, 122 Misc. 757 [204 N.Y. Supp. 11]; Brennan v. Barnes, 133 Misc. 340 [232 N.Y. Supp. 112]; Fletcher Cyclopedia Corporations (Perm Ed.), vol. 3, sec. 1314; see, also, Reetz v. Kitch, 230 Wis. 1 [283 N.W. 348].) Harvey v. Meigs, 17 Cal.App. 353 [119 P. 941], and Fornaseri v. Cosmosart Realty etc. Corp., 96 Cal.App. 549 [274 P. 597], cited by defendants are not contrary to the views above expressed. The statement in the Harvey case that the directors of the corporation should have been made parties is dictum, and if anything, merely indicates that they would be proper parties. In the Fornaseri case the statement was made with reference to a creditor's suit against a corporation for fraud that the delinquent officers must be made parties.
 [14] Defendants urge that the second cause of action is uncertain in that it cannot be ascertained therefrom "which of the charges for labor or materials it is claimed were exorbitant." We cannot agree. The particular materials and labor that were exorbitant or not furnished were peculiarly within the knowledge of the defendants. The plaintiff specifically sets forth the warrants that were issued, and alleges that the claims upon which they were based were not itemized. Under those circumstances the records of the county would not show the precise materials and labor which were questioned. Therefore, the case of Hansen v. Carr, supra, cited by defendants, dealing with the necessity of pleading matters of record is not in point. Furthermore, it must be remembered that the gist of plaintiff's second cause of action may be said to be the violation of section 4041.18 of the Political Code, rather than the payment of claims for materials which were not furnished.
 [15] Defendants argue that several causes of action were improperly united and not separately stated; that is, that each warrant, or at least each resolution of the board for the issuance of the several warrants, is a separate and illegal expenditure giving rise to a separate cause of action. Warrants were issued on thirteen different dates. This contention is untenable. According to the allegations of the complaint, all of the warrants and the resolutions authorizing them were a part of one transaction; that is, for the one job of repairing and altering the buildings at the county quarry, and against *101 the same defendants. There was one wrong manifested by several incidents, and therefore one cause of action accrued. (See Covey v. England & McCaffrey, 233 App. Div. 332 [253 N.Y. Supp. 340]; Broderick v. Marcus, 146 Misc. 240 [261 N.Y. Supp. 625].)
 [16] Finally, it is asserted by defendant Flood, that the demurrers were properly sustained because the demand for the repayment of the amounts illegally expended was not first submitted to the attorney general with the request to him to act thereon. This contention is clearly without merit as there is no express imperative duty imposed upon the attorney general to recover funds illegally expended by a county. (Cal. Const., art. V, sec. 21; Pol. Code, sec. 470.) That duty is placed upon the district attorney. (Pol. Code, sec. 4005b.) The policy that it is preferable to have such cases prosecuted by the district attorney, a representative of the county, is satisfied when there is a request that he act followed by his refusal to do so.
 The judgment is reversed and the trial court directed to overrule the demurrers and permit defendants to answer if they be so advised.
 Gibson, C.J., Shenk, J., Curtis, J., and Houser, J., concurred.
