I have an asp.net web service project. This project contains a few classes declared in their own files. One of these classes is called clsUser.
The clsUser consists of string firstName, string passWord and bool enabled (a lot more actually but just to keep it simple). I want the creator of the client code to be able to access the firstName and passWord members so changes can be made, but I do not want them accessing the enabled bool.
So I made firstName and passWord public, and made enabled internal (so that I may access it in my web service code). The thing is, I have to use MonoDevelop to get this .Net web service up on our linux servers and anything declared as internal is not seen by Mono.
Is there another way I can keep certain member accessible in my web service code but keep it hidden from clients??
Create a separate ‘surrogate’ class that contains only the members you’re willing to expose, and return an instance of that populated from the original clsUser instance, instead of an instance of clsUser.