EF auto-generate the DbContext class from my edmx file (database first) and use table names as default names for all this DbContext properties (ex: public DbSet<Student> student { get; set; })
If I make some change in this file (ex: like renaming properties name from student to Students), my changes are lost everytime I save my model because EF regenerate the DbContext class file.
How can I change this default behaviour and be able to make my customization and stop losing it?
To elaborate on what Pawel said.. The EDMX file (the designer) is the source of everything. Any changes you need to make to the generated items should be done there. You can add additional methods or properties through partial classes, but you can’t change existing ones.. so it must be changed in the source EDMX file.
Just right click on the Table in the designer, and rename it. This doesn’t change the underlying table name (at least in Database First reverse engineering, model first is a different story).