Optimize Entity Framework performance

This wouldn’t be a complete article on how to improve EF performance but only a little reminder.
Every time you have performance problem on updating or adding entity these properties will help you.

public void SetOptimization()
    // this flag produce a huge performance change improvement
    this.Configuration.AutoDetectChangesEnabled = false;
    // turn off this flag increase little performance so my suggestion is do not turn it off
    this.Configuration.ValidateOnSaveEnabled = false; // I usually use it turned on

You can find a lot of articles about these properties so I suggest reading more in detailed article.
This is only a remind every time I forget the right properties’ names


Informazioni su Andrea Regoli

Project Manager .Net Developer WPF WP7 Asp.Net c# javascript ajax SQL sharepoint
Questa voce è stata pubblicata in .Net, Entity Framework. Contrassegna il permalink.


Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione /  Modifica )

Google+ photo

Stai commentando usando il tuo account Google+. Chiudi sessione /  Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione /  Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione /  Modifica )


Connessione a %s...

This site uses Akismet to reduce spam. Learn how your comment data is processed.