
698 P.2d 995 (1985)
73 Or.App. 495
Kenneth C. WHEELER, Respondent,
v.
BUCKSTEEL CO., an Oregon Corporation, Appellant.
43-444, CA A32918.
Court of Appeals of Oregon.
Argued and Submitted March 13, 1985.
Decided May 1, 1985.
Reconsideration Denied June 14, 1985.
Andrew M. Rich, Hillsboro, argued the cause for appellant. With him on the brief were Huffman, Zenger and Rich, Hillsboro.
Stanley D. Gish, Portland, argued the cause for respondent. With him on the brief were Gish and Crawford, Portland.
Before GILLETTE, P.J., and VAN HOOMISSEN and YOUNG, JJ.
YOUNG, Judge.
Plaintiff brought this action to recover compensation for certain industrial engineering services that he performed for defendant. In a supplemental answer and counterclaim,[1] defendant alleged that, because plaintiff was not a registered engineer, ORS 672.020(1), the contract for his services was illegal. Before trial, the court struck those allegations. At trial, the court excluded evidence that plaintiff was not a registered engineer.[2] Defendant's *996 motion for directed verdict was denied. The jury returned a verdict for plaintiff, and defendant appeals. The dispositive question is whether plaintiff can legally contract to provide engineering services without being a registered engineer. We hold that he cannot and reverse.
The seminal case that considered the validity of a contract in which one of the parties has violated a statutory prohibition is Uhlmann v. Kin Daw, 97 Or. 681, 193 P. 435 (1920). The relevant statute prohibited the conduct of business under an assumed name without having registered the name and provided that no person could file or maintain an action without pleading and proving registration. The court held that the statute only affected the plaintiff partnership's capacity to sue, not the legality of the contract, and that the plaintiff had removed the incapacity by registering before suing.
Kin Daw treated the question of the legality of the contract as one of legislative intent. In doing so, it distinguished between statutory duties which are collateral to the purpose of the contract and those which are central to it.
"The agreement is an illegal one if the taint of illegality manifests itself in the consideration, or in a promise expressed in the agreement, or in the purpose to which the agreement is applied[.]
"* * *
"A statute may have as its primary purpose the prohibition of an act or acts in a given field; or, on the other hand, the statute may have for its primary purpose the imposition of duties which are entirely collateral to a given act or agreement arising out of it[.]" 97 Or. at 688, 691, 193 P. 435.
Because the pertinent inquiry is legislative intent, it is necessary to look at the entire statutory scheme to determine whether the questioned contract is enforcible. The general rule is that an agreement which violates a statutory prohibition is illegal; a contrary result requires a clear basis in the statute.
"If a statute having a penalty and a prohibition, express or implied, or only a penalty or only a prohibition, is silent and otherwise contains nothing from which the contrary is to be inferred, then an agreement which conflicts with the statute is void. However, upon finding a statute with either a penalty or a prohibition, or both, the court is not immediately debarred from further prosecuting an inquiry as to whether an agreement is void and unenforceable in a court of justice[.]" Uhlmann v. Kin Daw, supra, 97 Or. at 689, 193 P. 435. (Emphasis supplied.)
The court upheld the agreement in Kin Daw, because the assumed business name statute was collateral to the loan and mortgage. "[T]he primary purpose is, not to prevent business, but to require the performance of a statutory duty which is entirely collateral to any agreement that may arise out of any business transaction." 97 Or. at 692, 193 P. 435. The very fact that the statute disabled an unregistered person from bringing a lawsuit was inconsistent with an intent to void the agreement. "If an agreement is void when made by one failing to file a certificate, why declare in a statute that a suit cannot be maintained?" 97 Or. at 693, 193 P. 435.
Schramm v. Bank of California, 143 Or. 546, 20 P.2d 1093, 23 P.2d 327 (1933) and Hunter v. Cunning, 176 Or. 250, 154 P.2d 562, 157 P.2d 510 (1945), also consider the enforcibility of contracts that violate a statutory prohibition. They, as well as Uhlmann v. Kin Daw, supra, require an examination of the entire statutory scheme, rather than emphasizing the presence or absence of a particular provision, to determine whether the statutory prohibition goes to the substance of the challenged agreement or is collateral to it and the relation of the protective purpose of the legislation to the subject matter of the contract. Although in Kin Daw and Hunter the pertinent statutes contained restrictions on bringing legal actions, such provisions are not essential to holding a contract unenforceable. Indeed, the court in Kin Daw treated the provision as an indication *997 that the legislature did not intend to invalidate non-complying contracts but only to require the plaintiff to comply with the law before commencing an action. Recent cases have followed these principles. See Ogan v. Ellison, 297 Or. 25, 682 P.2d 760 (1984); Mountain Fir Lbr Co. v. EBI Co., 296 Or. 639, 679 P.2d 296 (1984).[3]
In Grimmett Excav. Contr. v. Farmers & Merchants Bk., 64 Or. App. 399, 668 P.2d 439 (1983), we invalidated an agreement to loan the plaintiff money, because the agreement was reached before the defendant bank had received its charter. A statute prohibited the bank from doing business before then. We held that the statute was intended to protect the public and that an agreement reached in violation of it was void. The statute did not explicitly invalidate such agreements.
ORS 672.020(1) provides:
"In order to safeguard life, health and property, no person shall practice or offer to practice engineering in this state unless he is registered and has a valid certificate to practice engineering issued under ORS 672.002 to 672.325."
ORS 672.045 provides in part:
"A person shall not:
"(1) Engage in the practice of engineering or land surveying without having a valid certificate or permit to so practice issued in accordance with ORS 672.002 to 672.325.
"(2) Falsely represent, by any means, that he is authorized to practice engineering or land surveying."
The statutes also contain provisions for the issuance of certificates on the basis of an examination or other proof of competence, ORS 672.090, 672.125, for revocation of a certificate for gross negligence or incompetence, conviction of a felony or unethical conduct, ORS 672.200, and for the creation of a State Board of Engineering Examiners to administer the statutes. ORS 672.240 to 672.310.
The Professional Engineer Registration Act is designed to protect the public from evils "which, from experience, we know society must be guarded against by preventive legislation." Hunter v. Cunning, supra, 176 Or. at 275, 154 P.2d 562. The dangers of incompetent engineers to the public at large are obvious. The law provides for thorough regulation of the profession in order to maintain the necessary standards of competence and ethical behavior. The acts which the statute prohibits on plaintiff's part go to the very heart of his agreement with defendant: they prohibit him from performing the services he agreed to perform and for which he now seeks payment. We see no basis for holding that the legislature intended that a contract entered into in violation of these express prohibitions should be valid as to plaintiff.
Plaintiff emphasizes that the act does not explicitly invalidate non-complying agreements or limit plaintiff's right to bring an action. He points out that some other occupational licensing statutes contain such provisions, citing ORS 671.220(3) (architects), ORS 696.710 (real estate brokers), and ORS 701.065 (builders). Such a provision is not necessary. The various occupational licensing statutes are not in pari materia; each must stand on its own. The legislature prohibited plaintiff from providing engineering services without being registered. That prohibition necessarily makes the contract unenforceable. The statute provides no basis for holding otherwise. See Uhlmann v. Kin Daw, supra, 97 Or. at 689, 193 P. 435. The trial court erred by striking the defense of illegality and by rejecting evidence of plaintiff's lack of registration as an engineer. The motion for a directed verdict should have been granted.
Reversed and remanded for entry of judgment for defendant.
NOTES
[1]  The counterclaim is not involved in this appeal.
[2]  Defendant's offer of proof that plaintiff was not a registered engineer is not disputed.
[3]  See also Turney v. J.H. Tillman Co., 112 Or. 122, 228 P. 933 (1924), in which the court allowed workers to collect overtime pay for work actually performed despite the employer's argument that the agreement to work overtime was illegal. The court stated that contracts in violation of a statute may be enforced when necessary to save from injury those for whose protection the statute was enacted. 112 Or. at 128, 228 P. 933.
