File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66namespace TechInventory . Data . UnitOfWork ;
77
8- public class UnitOfWork ( InventoryDbContext context , ILogger < UnitOfWork > logger ) : IUnitOfWork , IDisposable
8+ public class UnitOfWork : IUnitOfWork , IDisposable
99{
1010 private readonly InventoryDbContext _context = context ;
11- private readonly ILogger < UnitOfWork > _logger = logger ;
11+
12+ public UnitOfWork ( InventoryDbContext context )
13+ {
14+ _context = context ;
15+ }
1216
1317 private IRepository < Device > deviceRepository ;
1418 private IRepository < DeviceModel > deviceModelRepository ;
@@ -65,8 +69,7 @@ public async Task<Result<bool>> CommitAsync()
6569 }
6670 catch ( DbUpdateException ex )
6771 {
68- _logger . LogError ( ex , "UnitOfWork::Commit falhou" ) ;
69- return Result < bool > . Failure ( "Não foi possível salvar as informações (erro interno)" , false ) ;
72+ return Result < bool > . Failure ( $ "Não foi possível salvar as informações { ex . Message } ", false ) ;
7073 }
7174 }
7275
You can’t perform that action at this time.
0 commit comments