I am using Entity Framework Database First for working with db.
I have a base class EntityBase
public class EntityBase
{
public Int32 Id { get; set; }
}
I have some other classes that are generated by EnitytFramework and represents tables of my db, for example, "User" class:
public class User
{
public int32 Id{get;set;}
public class Name{get;set;}
public class Age{get;set;}
}
I want all EF model classes to be inherited from EntityBase:
public class User : EntityBase
I can do this manually, by deleting Id field from User class and defining inheritance, but after I am updating model from db, all manually-made changes dissapears. Is there any way to keep or automatically add inheritance to EF model classes?