Must all c# code be contained within a class?
Can I create a stand alone function outside of a class that is called by a method inside a class?
If that's the case then it seems to me that if I have a class from which I make hundreds of objects such as an employee class, and within that class there is a method which creates a unique employee ID, rather than creating hundreds of employee objects each of which with a duplicate method which takes up memory, that it would seem better to create one function that does the same thing that is called from each object.
Of course this wont work if there are no stand alone functions.
tex
Can I create a stand alone function outside of a class that is called by a method inside a class?
If that's the case then it seems to me that if I have a class from which I make hundreds of objects such as an employee class, and within that class there is a method which creates a unique employee ID, rather than creating hundreds of employee objects each of which with a duplicate method which takes up memory, that it would seem better to create one function that does the same thing that is called from each object.
Of course this wont work if there are no stand alone functions.
tex