Created
March 12, 2021 20:38
-
-
Save rafaelpadovezi/589ecb39f29d9502ab1382d190fa3cb0 to your computer and use it in GitHub Desktop.
Creating savepoints
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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