开发者

What are the best practises to improve the application performace while using LINQ Queries?

Could any one tell me how to impr开发者_高级运维ove the application performance while writing LINQ Queries ?Like the optimization techniques.


I think that: 1) You must fetch only date that you need. 2) Use DataLoadOptions

  DataLoadOptions options = new DataLoadOptions();
  options.AssociateWith<Category>(cat=> cat.Products.Where<Product>(prod => prod.IsValid));
  context.LoadOptions = options;

it is optimize you sql query.

3) Turn off ObjectTrackingEnabled

context.ObjectTrackingEnabled = false;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜