private async Task CreateProZeroDbContextAsync() { var optionsBuilder = new DbContextOptionsBuilder <ProZeroContext>() .UseSqlServer(SecretConfiguration.ConnectionString) .optionsBuilder; var dbContext = new ProZeroContext(optionsBuilder.Options ?? throw new Exception("Failed to create DbContext...")); _disposables.Add(dbContext); DbContext = dbContext; }
public ProZeroRepo(ProZeroContext dbContext, ILogger <ProZeroRepo> logger) { _dbContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); }