This post was most recently updated on December 15th, 2014
One of the biggest issue when we use entity framework that is when we request for one single table you will get all related tables in table object.
for example:
1 2 3 |
var company = (from s in ctx.Company where s.CompanyID == 4 select s).ToList(); |
in above code you will get all related tables in company object.
We can avoid this using Lazy loading.
for example:
1 2 3 4 5 6 7 8 9 10 |
public partial class Company: DbContext { public Company() { this.Configuration.LazyLoadingEnabled = false; } } |
in this case you can get only company table not related table