Created
October 20, 2021 08:23
-
-
Save KangDroid/68fe40380c3db3deb6a552acf3e11ca8 to your computer and use it in GitHub Desktop.
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
// Transaction 내부에 있는 데이터베이스 작업들은 Atomic합니다! | |
await using (var transaction = await _dbContext.Database.BeginTransactionAsync()) | |
{ | |
var entity = await _dbContext.AnalysisModels.FindAsync(id); | |
entity.Field = "test"; // Update | |
await _dbContext.SaveChangesAsync(); | |
await transaction.CommitAsync(); // Finish Transaction | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment