Update dependencies and integrate EnvelopeGenerator
Updated `DigitalData.Auth.Tests.csproj` to include `Microsoft.EntityFrameworkCore` version `8.0.17`. Refactored `AuthController.cs` to remove unused imports and update to the latest `DigitalData.Core.Abstraction.Application` namespaces. Streamlined `DigitalData.Auth.API.csproj`: - Changed target framework to `net8.0`. - Upgraded `DigitalData.Core.Abstractions` to `4.3.0` and `DigitalData.Core.Application` to `3.4.0`. - Added `EnvelopeGenerator` and `Microsoft.EntityFrameworkCore` dependencies. - Removed outdated `UserManager` dependencies. Enhanced `Program.cs`: - Integrated `EnvelopeGenerator` services with database context and caching configuration. - Removed `AddUserManager` service registration. - Added SQL Server logging and error handling for `DbContext`. These changes improve maintainability, adopt modern frameworks, and introduce new functionality with `EnvelopeGenerator`.
This commit is contained in:
@@ -8,6 +8,9 @@ using DigitalData.Core.Application;
|
||||
using DigitalData.Core.Security.Extensions;
|
||||
using DigitalData.UserManager.Application;
|
||||
using DigitalData.UserManager.Application.DTOs.User;
|
||||
using DigitalData.UserManager.DependencyInjection;
|
||||
using EnvelopeGenerator.DependencyInjection;
|
||||
using EnvelopeGenerator.Infrastructure;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.IdentityModel.JsonWebTokens;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
@@ -74,8 +77,6 @@ try
|
||||
|
||||
var cnn_str = builder.Configuration.GetConnectionString("Default") ?? throw new InvalidOperationException("Default connection string is not found.");
|
||||
|
||||
builder.Services.AddUserManager(cnn_str);
|
||||
|
||||
builder.Services.AddControllers();
|
||||
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
@@ -145,6 +146,30 @@ try
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
// Add envelope generator services
|
||||
builder.Services.AddEnvelopeGenerator(config,
|
||||
infrastructureOptions: opt =>
|
||||
{
|
||||
opt.AddDbTriggerParams(config);
|
||||
opt.AddDbContext((provider, options) =>
|
||||
{
|
||||
var logger = provider.GetRequiredService<ILogger<EGDbContext>>();
|
||||
options.UseSqlServer(cnn_str)
|
||||
.LogTo(log => logger.LogInformation("{log}", log), Microsoft.Extensions.Logging.LogLevel.Trace)
|
||||
.EnableSensitiveDataLogging()
|
||||
.EnableDetailedErrors();
|
||||
});
|
||||
},
|
||||
options: opt =>
|
||||
{
|
||||
opt.SqlCacheOptions = new()
|
||||
{
|
||||
ConnectionString = cnn_str,
|
||||
SchemaName = "dbo",
|
||||
TableName = "TBDD_CACHE"
|
||||
};
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user