Skip to content

Instantly share code, notes, and snippets.

@rafaelpadovezi
Created March 12, 2021 20:38
Show Gist options
  • Save rafaelpadovezi/589ecb39f29d9502ab1382d190fa3cb0 to your computer and use it in GitHub Desktop.
Save rafaelpadovezi/589ecb39f29d9502ab1382d190fa3cb0 to your computer and use it in GitHub Desktop.
Creating savepoints
using var transaction = context.Database.BeginTransaction();
context.Add(new Employee { Name = "John Doe" });
context.SaveChanges();
transaction.CreateSavepoint("A");
context.Add(new Employee { Name = "Jane Doe" });
context.SaveChanges();
transaction.Commit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment