I am using a transaction and want to learn to commit inner commit?
await using var transaction = await _context.Database.BeginTransactionAsync();
try
{
// update table 1
// update table 2
await _context.SaveChangesAsync(); // necessary to use this???
await transaction.CommitAsync(); // necessary to use this???
}
catch (Exception)
{
await transaction.RollbackAsync();
throw;
}
Should I use commit transaction after await _context.SaveChangesAsync();
. My entity framework version is core 3.0.