11using Microsoft . EntityFrameworkCore ;
2- using Microsoft . EntityFrameworkCore . Infrastructure ;
3- using Microsoft . EntityFrameworkCore . Storage ;
2+ using Microsoft . EntityFrameworkCore . Diagnostics ;
43using Microsoft . eShopOnContainers . BuildingBlocks . EventBus . Events ;
4+ using System ;
55using System . Data . Common ;
66using System . Linq ;
77using System . Threading . Tasks ;
8- using System ;
9- using Microsoft . EntityFrameworkCore . Diagnostics ;
108
119namespace Microsoft . eShopOnContainers . BuildingBlocks . IntegrationEventLogEF . Services
1210{
@@ -17,7 +15,7 @@ public class IntegrationEventLogService : IIntegrationEventLogService
1715
1816 public IntegrationEventLogService ( DbConnection dbConnection )
1917 {
20- _dbConnection = dbConnection ?? throw new ArgumentNullException ( " dbConnection" ) ;
18+ _dbConnection = dbConnection ?? throw new ArgumentNullException ( nameof ( dbConnection ) ) ;
2119 _integrationEventLogContext = new IntegrationEventLogContext (
2220 new DbContextOptionsBuilder < IntegrationEventLogContext > ( )
2321 . UseSqlServer ( _dbConnection )
@@ -27,13 +25,13 @@ public IntegrationEventLogService(DbConnection dbConnection)
2725
2826 public Task SaveEventAsync ( IntegrationEvent @event , DbTransaction transaction )
2927 {
30- if ( transaction == null )
28+ if ( transaction == null )
3129 {
32- throw new ArgumentNullException ( " transaction" , $ "A { typeof ( DbTransaction ) . FullName } is required as a pre-requisite to save the event.") ;
30+ throw new ArgumentNullException ( nameof ( transaction ) , $ "A { typeof ( DbTransaction ) . FullName } is required as a pre-requisite to save the event.") ;
3331 }
34-
32+
3533 var eventLogEntry = new IntegrationEventLogEntry ( @event ) ;
36-
34+
3735 _integrationEventLogContext . Database . UseTransaction ( transaction ) ;
3836 _integrationEventLogContext . IntegrationEventLogs . Add ( eventLogEntry ) ;
3937
0 commit comments