I’m using mvc 4, with database first.
Everytime I refresh the model.edmx file, the display name attribute I added is removed. How can I the keep display name attribute between refreshes?
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.
You are going to want to use
System.ComponentModel.DataAnnotations. Here is a simplistic Example for a ‘User’ table in EF to show you how:You can also include validation in your class as well. Be sure it is a partial class named the exact same – also do not forget that it must be in the exact same namespace as your .edmx.