Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

Any example of having faster processing using Entity framework?

user-image
Question added by Khurram Yazdani , Senior Manager , PAF Hospital
Date Posted: 2016/07/12
Morad Aktam
by 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