namespace MyNameSpace { static class MyClass { static MyClass() { //Authentication process.. User needs to enter password
The static constructor will be called before mymethod is executed. However if you are screwed if 4 is called before 2 then I suggest you re-think your design. Should not be doing complicated stuff in a static constructor anyway.