diff --git a/src/SampleBatch.Components/Activities/CancelOrder/CancelOrderActivity.cs b/src/SampleBatch.Components/Activities/CancelOrder/CancelOrderActivity.cs index f4c3ff5..7c042bd 100644 --- a/src/SampleBatch.Components/Activities/CancelOrder/CancelOrderActivity.cs +++ b/src/SampleBatch.Components/Activities/CancelOrder/CancelOrderActivity.cs @@ -10,10 +10,12 @@ public class CancelOrderActivity : IExecuteActivity { + private readonly SampleBatchDbContext _dbContext; readonly ILogger _logger; - public CancelOrderActivity(ILoggerFactory loggerFactory) + public CancelOrderActivity(SampleBatchDbContext dbContext, ILoggerFactory loggerFactory) { + _dbContext = dbContext; _logger = loggerFactory.CreateLogger(); } diff --git a/src/SampleBatch.Components/Activities/SuspendOrder/SuspendOrderActivity.cs b/src/SampleBatch.Components/Activities/SuspendOrder/SuspendOrderActivity.cs index 8a470e7..8cc1938 100644 --- a/src/SampleBatch.Components/Activities/SuspendOrder/SuspendOrderActivity.cs +++ b/src/SampleBatch.Components/Activities/SuspendOrder/SuspendOrderActivity.cs @@ -10,10 +10,12 @@ public class SuspendOrderActivity : IExecuteActivity { + private readonly SampleBatchDbContext _dbContext; readonly ILogger _logger; - public SuspendOrderActivity(ILoggerFactory loggerFactory) + public SuspendOrderActivity(SampleBatchDbContext dbContext, ILoggerFactory loggerFactory) { + _dbContext = dbContext; _logger = loggerFactory.CreateLogger(); } diff --git a/src/SampleBatch.Service/Program.cs b/src/SampleBatch.Service/Program.cs index bee937f..feec0c6 100644 --- a/src/SampleBatch.Service/Program.cs +++ b/src/SampleBatch.Service/Program.cs @@ -84,7 +84,7 @@ static async Task Main(string[] args) cfg.AddBus(ConfigureBus); }); - services.AddDbContext(x => x.UseSqlServer(hostContext.Configuration.GetConnectionString("sample-batch"))); + services.AddDbContext(x => x.UseSqlServer(hostContext.Configuration.GetConnectionString("sample-batch"))); services.AddHostedService();