Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

Any example of having faster processing using Entity framework?

user-image
Question ajoutée par Khurram Yazdani , Senior Manager , PAF Hospital
Date de publication: 2016/07/12
Morad Aktam
par Morad Aktam , Senior Software Engineer / .NET developer , Chipsoft

There many Technics that you can follow in order to get performance using entity framework. Following are some hints that may help you reaching your goals:

  1. Favor foreign key relationships over independent relationships between the entities.
  2.  Use pre-generated views in order to minimize cold queries.
  3. When reading records that you may not use directly on your data context, use the asnotracking  function in your LINQ queries to avoid updating the object graph which is time consuming.
  4. It depends on the context, however favoring eager or lazy loading may make a lot of difference. And when using eager loading don't use more that three includes in one query.

More Questions Like This