Entity Framework .Include() with compile time checking?
- by Mikey Cee
Consider the following code, which is calling against an EF generated data context:
var context = new DataContext();
var employees = context.Employees.Include("Department");
If I change the name of the entity Department then this code is going to start throwing a runtime error. So I'll have to do some kind of find and replace throughout my code…