01 August 2013

Optimize LINQ Queries

Two of the most important techniques that I always use to optimize my LINQ Queries are:

ctx.ContextOptions.LazyLoadingOptions = false; //to disable lazyloading

ctx.Employees.MergeOption = System.Data.Objects.MergeOption.NoTracking;

Try it yourself and see the difference.

No comments:

Post a Comment