refactor(DIExtensions): Option zum Hinzufügen von db-Kontext über dbContextOptions-Eingang hinzugefügt
This commit is contained in:
@@ -15,6 +15,7 @@ using DigitalData.EmailProfilerDispatcher;
|
||||
using EnvelopeGenerator.Infrastructure;
|
||||
using EnvelopeGenerator.Web.Sanitizers;
|
||||
using EnvelopeGenerator.Application.Contracts.Services;
|
||||
using EnvelopeGenerator.Application.Extensions;
|
||||
|
||||
var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger();
|
||||
logger.Info("Logging initialized!");
|
||||
@@ -80,7 +81,7 @@ try
|
||||
|
||||
//AddEF Core dbcontext
|
||||
var connStr = config.GetConnectionString(Key.Default) ?? throw new InvalidOperationException("There is no default connection string in appsettings.json.");
|
||||
builder.Services.AddDbContext<EGDbContext>(options => options.UseSqlServer(connStr));
|
||||
|
||||
builder.Services.AddDistributedSqlServerCache(options =>
|
||||
{
|
||||
options.ConnectionString = connStr;
|
||||
@@ -89,7 +90,9 @@ try
|
||||
});
|
||||
|
||||
// Add envelope generator services
|
||||
builder.Services.AddEnvelopeGenerator(config);
|
||||
builder.Services.AddEnvelopeGeneratorRepositories(options => options.UseSqlServer(connStr));
|
||||
|
||||
builder.Services.AddEnvelopeGeneratorServices(config);
|
||||
|
||||
builder.Services.Configure<CookiePolicyOptions>(options =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user