
233 S.E.2d 658 (1977)
32 N.C. App. 630
MECKLENBURG COUNTY, a Political Subdivision of the State of North Carolina
v.
John R. WESTBERY and wife, Patricia Westbery.
No. 7626SC724.
Court of Appeals of North Carolina.
April 6, 1977.
*660 Ruff, Bond, Cobb, Wade & McNair by Hamlin L. Wade, Charlotte, for plaintiff-appellee.
Curtis & Millsaps by Cecil M. Curtis, Charlotte, for defendants-appellants.
CLARK, Judge.
G.S. 1A-1, Rule 56 permits a summary judgment upon a showing of two conditions: (1) that there is no genuine issue as to any material fact, and (2) that one party is entitled to a judgment as a matter of law.
In the present appeal defendant brings forward three assignments of error. Though not precisely categorized as such, one assigns error to the determination that no genuine issue existed as to any material fact, and two assign error to the determination that plaintiff is entitled to judgment as a matter of law.
Defendants' first assignment concerns conclusions by the trial court that there was no issue as to whether the structure in question was a mobile home. Defendants cite evidence in the record tending to show that the structure has never been occupied nor is equipped to be occupied for living, and cite the definition of a mobile home in the Mecklenburg County Zoning Ordinance, which refers to "a moveable or portable dwelling place". Defendants contend that a genuine issue exists whether the structure in question is a "dwelling" place or a storage structure, and therefore whether it is a mobile home as defined in the zoning ordinance.
A question of fact which is immaterial does not preclude summary judgment. Railway Co. v. Werner Industries, 286 N.C. 89, 209 S.E.2d 734 (1974). Kessing v. Mortgage Corp., 278 N.C. 523, 180 S.E.2d 823 (1971). An issue is material if the facts alleged are such as to constitute a legal defense or are of such nature as to affect the result of the action, or if the resolution of the issue is so essential that the party against whom it is resolved may not prevail. Zimmerman v. Hogg & Allen, 286 N.C. 24, 209 S.E.2d 795 (1974); McNair v. Boyette, 282 N.C. 230, 192 S.E.2d 457 (1972). Whether the structure in question was a storage structure or a mobile home is of no consequence in this case, since in either event defendants had no building permit for the structure. G.S. 153A-357 provides that "No person may commence or proceed with: (1) The construction . . . of any building . . . without first securing from the inspection department with jurisdiction over the site of the work each permit required by . . . local ordinance . . . ." Section 14-2 of the Mecklenburg County Zoning Ordinance requires a permit from the zoning administrator before "commencing the construction or erection of any building or structure.. . ." The only permit that defendants had, which was for the construction of a storage structure, was revoked by the zoning administrator on 4 November 1974. No appeal was taken from that decision to the Board of Adjustment as is provided for in Section 15-4 of the Zoning Ordinance. The parties stipulated that that permit had been issued mistakenly. In response to the motion for summary judgment, defendants offered no evidence that revocation was based upon an erroneous interpretation of the *661 zoning ordinance. Defendants' application for a permit for the installation of the mobile home was denied on 13 February 1975. Their appeal to the Board of Adjustment pursuant to Section 15-4 was also denied. They did not apply for writ of certiorari to the Superior Court for review of this decision as provided for in G.S. 153A-345(e). Since defendants have no permit for this structure irrespective of whether it serves as a storage structure or a mobile home, its presence is in violation of G.S. 153A-351 and Section 14-2 of the Mecklenburg County Zoning Ordinance. Therefore the issue as to whether it is a storage structure or a mobile home is not material and its existence cannot be grounds for denying a summary judgment.
Defendants also assign error to the entry of summary judgment on the ground that plaintiff should be estopped from denying the validity of the permit issued for the construction of the storage structure on 17 October 1974, and therefore is not entitled to judgment as a matter of law. Defendants contend that since it is uncontroverted that they incurred a substantial expense in good faith reliance upon that permit before it was revoked, they have a right to continue their use. Defendants rely upon Town of Hillsborough v. Smith, 276 N.C. 48, 170 S.E.2d 904 (1969). However, that case makes it clear that the permit must have been lawfully issued in order for the holder of the permit to acquire a vested right in the use. In that case, after the holder of the permit had made substantial contractual obligations based on a lawfully issued permit, a change in the zoning district made his planned use illegal. The court held that defendant could not be denied his use. In this case, the permit was mistakenly issued. The planned usage was illegal from its inception. G.S. 153A-362 expressly provides for the revocation of a permit mistakenly issued in violation of local ordinance. In Raleigh v. Fisher, 232 N.C. 629, 61 S.E.2d 897 (1950), a municipality was allowed to enforce a zoning ordinance against a property owner who had been erroneously given a permit and had made substantial expenditures for ten years in reliance on the permit. Justice Ervin put the plight of the private citizen into proper perspective by noting that
"Undoubtedly this conclusion entails much hardship to the defendants. Nevertheless, the law must be so written; for a contrary decision would require an acceptance of the paradoxical proposition that a citizen can acquire immunity to the law of his country by habitually violating such law with the consent of unfaithful public officials charged with the duty of enforcing it." 232 N.C. at 635, 61 S.E.2d at 902.
See also Helms v. Charlotte, 255 N.C. 647, 122 S.E.2d 817 (1961). We find no merit to this assignment of error.
Defendant's third assignment of error raises the issue of whether plaintiff was entitled to equitable relief. Defendants contend that any sanction for violation of a county zoning ordinance must be contained within the ordinance itself, and that the Mecklenburg County Zoning Ordinance provides only for fines and imprisonment. We note, however, that plaintiffs also alleged a violation of the building inspection laws of North Carolina, and alleged that injunctive relief was available under G.S. 153A-372. G.S. 153A-372 provides that

"Equitable enforcement.Whenever a violation is denominated a misdemeanor under the provisions of this Part, the county, either in addition to or in lieu of other remedies, may initiate any appropriate action or proceeding to prevent, restrain, correct, or abate the violation or to prevent the occupancy of the building involved."
As previously noted, G.S. 153A-357, which is a provision to which G.S. 153A-372 is applicable, and Section 14-2 of the Mecklenburg County Zoning Ordinance make it a misdemeanor to construct a building without a permit. G.S. 153A-350 states that "as used in this Part, the words `building' or `buildings' include other structures." We think it would defeat the clear intent of the drafters if the installation of a mobile home were not considered the construction of a *662 building within these provisions. We hold, therefore, that irrespective of the availability of injunctive relief to enforce the Mecklenburg County Zoning Ordnance, such relief is available to prevent a violation of G.S. 153A-357.
The judgment is
Affirmed.
BRITT and HEDRICK, JJ., concur.
