Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save grishin/8953465 to your computer and use it in GitHub Desktop.

Select an option

Save grishin/8953465 to your computer and use it in GitHub Desktop.
using (var context = new BloggingContext())
{
try
{
context.Configuration.AutoDetectChangesEnabled = false;
// Make many calls in a loop
foreach (var blog in aLotOfBlogs)
{
context.Blogs.Add(blog);
}
}
finally
{
context.Configuration.AutoDetectChangesEnabled = true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment