
267 S.W.3d 780 (2008)
STATE of Missouri ex rel CITY OF NEVADA, Missouri, Relator,
v.
The Honorable James R. BICKEL, Circuit Judge, Respondent.
No. WD 69491.
Missouri Court of Appeals, Western District.
September 30, 2008.
Motion for Rehearing and/or Transfer to Supreme Court Denied October 28, 2008.
Application for Transfer Denied November 25, 2008.
*781 Robert O. Jester, Kansas City, MO, for Relator.
Steven J. Borel, Olathe, KS, for Respondent.
Before THOMAS H. NEWTON, C.J., RONALD R. HOLLIGER, and ALOK AHUJA, JJ.
THOMAS H. NEWTON, Chief Judge.
The City of Nevada petitioned this court for a Writ of Prohibition, asserting that the trial court should have granted its motion for summary judgment based on sovereign immunity. We issued a preliminary Writ and now make that Writ absolute.

Factual and Procedural Background
In September of 2005, Joshua McKinney of ABBA Electric installed a new electric meter pedestal at a mobile home park in *782 Nevada, Missouri. Mr. McKinney also installed three wires connecting the pedestal to Paul and Connie Scott's recently purchased mobile home. The City of Nevada (the City) had adopted the National Electric Code (NEC)[1] by ordinance as the regulations governing electrical installations. NEVADA, MO., CODE § 11-9 (2005). The NEC requires a fourth grounding wire for electrical connections to mobile homes.[2] Mr. McKinney did not install the ground. Richard Brockman, an inspector for the City, arrived to inspect the installation pursuant to local ordinance. See NEVADA, MO., CODE § 11-22. The City charged a $12.50 fee for this inspection. Mr. Brockman did not know the mobile home installation required a fourth grounding wire, and he approved the improper installation. Aquila, Inc., the local electric company, then turned on power to the new pedestal and the Scotts' home. Two days later Mr. Scott was electrocuted.
Ms. Scott subsequently sued ABBA Electric, Mr. McKinney, the mobile home park owners, the sellers and the manufacturers of the Scott's mobile home, the City, and Mr. Brockman.[3] The City claimed sovereign immunity and moved for summary judgment. The trial court denied the City's motion and the City sought a writ of prohibition.

Standard of Review
A writ of prohibition is appropriate to correct interlocutory error where parties do not have adequate remedy by way of appeal. State ex rel. New Liberty Hosp. Dist. v. Pratt, 687 S.W.2d 184, 187 (Mo. banc 1985). A defendant entitled to immunity is not required to undergo an entire trial before appealing a ruling denying its protection. State ex rel. Bd. of Trs. of N. Kansas City Mem'l Hosp. v. Russell, 843 S.W.2d 353, 355 (Mo. banc 1992).
In determining whether to make our writ absolute, the sole issue we consider is whether the trial court erred in denying summary judgment to the City. We review summary judgment under an "essentially de novo" standard. ITT Commercial Fin. Corp. v. Mid-Am. Marine Supply Corp., 854 S.W.2d 371, 376 (Mo. banc 1993). Summary judgment is proper where there is no genuine issue of material fact and the movant is entitled to judgment as a matter of law. Id.

Legal Analysis
Where it applies, sovereign immunity is an absolute defense. See State ex rel. Div. of Motor Carrier & R.R. Safety v. Russell, 91 S.W.3d 612, 615 (Mo. banc 2002). In Missouri, common law sovereign immunity was reinstated by the legislature, with specific exceptions provided for by statute. See Russell, 843 S.W.2d at 357-58; § 537.600 RSMo Cum.Supp.2007. Under the common law, municipalities are immune from suit in tort for governmental functions, but may be liable for proprietary functions. Russell, 843 S.W.2d at 358. Governmental functions are activities undertaken for the benefit of the public. Junior Coll. Dist. of St. Louis v. City of St. Louis, 149 S.W.3d 442, 447 (Mo. banc 2004). A proprietary function is one in which the municipality acts for its own special benefit or profit. Dallas v. City of St. Louis, 338 S.W.2d 39, 44 (Mo. banc 1960).
*783 In analyzing whether a particular function is governmental or proprietary, we look to the generic nature of the activity that gave rise to the injury. Russell, 843 S.W.2d at 359. Here, the relevant activity is the City's performance of electrical inspections. The generic nature of the inspections is to enforce ordinances designed to protect public health and safety.[4] It is well established that enforcement of ordinances is a governmental function. See Bean v. City of Moberly, 350 Mo. 975, 169 S.W.2d 393, 397 (Mo. banc. 1943); Berger v. City of Univ. City, 676 S.W.2d 39, 41 (Mo.App. E.D.1984).
The trial court denied summary judgment for the City because it found "a potential issue of material fact may exist as to whether the City's receiving a fee for its electrical inspections . . . may result in the act of the inspection being in the City's pecuniary interest, and thereby perhaps making it a proprietary function." Similarly, Respondent contends that because the City's inspection was so negligent it was tantamount to performing no inspection at all, the purpose of the inspection could only be pecuniaryto collect the $12.50 feethus making it a proprietary function.
We find neither assertion persuasive. Charging a fee for a public service does not transform a governmental function into a proprietary one. State ex rel. Reg'l Justice Info. Serv. Comm'n v. Saitz, 798 S.W.2d 705, 708 (Mo. banc 1990); Pratt, 687 S.W.2d at 186. Nor does negligent performance of a public function, even grossly negligent performance, make a governmental function proprietary. Berger, 676 S.W.2d at 42.

Conclusion
Accordingly, the City was entitled to summary judgment on its claim of sovereign immunity. Our Writ is now made absolute.
RONALD R. HOLLIGER and ALOK AHUJA, JJ. concur.
NOTES
[1]  Nat'l. Elec.Code (Nat'l Fire Prot. Ass'n 2002).
[2]  NEC § 550.10(B).
[3]  The trial court granted summary judgment for Mr. Brockman under the public duty doctrine, which exempts public officers from liability for breaches of duties owed to the general public. See Jamierson v. Dale, 670 S.W.2d 195, 196 (Mo.App. W.D.1984).
[4]  See NEC § 90.1(A): "The purpose of this Code is the practical safeguarding of persons and property from hazards arising from the use of electricity."
