I'm trying to learn Entity Framework. I have a database but it's not complete yet so i will add fields to my database and my model in future. I can do that easily and Entity Framework updating the class code accordingly. The problem is, for example i add this line to the code:
[Required()]
So it becomes like this:
[Required()]
public string BranchName { get; set; }
After adding a new field to database and my model, this code gets generated again and parts i include disappears. This makes sense and there is a huge warning above the code saying Auto Generated but i need to deal with it somehow. I want to use validation codes but i want to add new fields to the database too (obviously).
I can manually add my new fields to classes but how can i disable auto code generation? Also i don't want to do this if there is an other way, because i will change my models very frequently and it will be hard if there are so many new fields.
Hope i'm clear enough, thanks.