Can I make EF to generate entity classes with private property setters?
Eg. I want something like
public class MyTable
{
public Guid Id {get; private set;}
//... And so on and so forth, basically the class should hide the setters
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming that you are using tt templates to generate POCO entities, by modifying the tt file it is possible.
On the otherhand, since private variables will not be serialized during WCF communication, you will face with problems if you are using any service – client architecture and exchanging generated entities.