Для транзакции блок try-catch больше не нужен
This commit is contained in:
parent
4ccbe4361a
commit
42fe4dee50
@ -101,8 +101,7 @@ public class ChangeLogRepository : IChangeLogRepository
|
||||
|
||||
var result = 0;
|
||||
using var transaction = await db.Database.BeginTransactionAsync(token);
|
||||
try
|
||||
{
|
||||
|
||||
foreach (var dto in dtos)
|
||||
{
|
||||
var updatedEntity = updatedEntities.GetValueOrDefault(dto.Id);
|
||||
@ -123,12 +122,8 @@ public class ChangeLogRepository : IChangeLogRepository
|
||||
await transaction.CommitAsync(token);
|
||||
|
||||
return result;
|
||||
}
|
||||
catch
|
||||
{
|
||||
await transaction.RollbackAsync(token);
|
||||
throw;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public async Task<PaginationContainer<DataWithWellDepthAndSectionDto>> GetByDate(
|
||||
|
Loading…
Reference in New Issue
Block a user