feat: add Logs

This commit is contained in:
2026-09-20 16:21:15 +07:00
parent 637ca51f47
commit d3c3ecd5e6
62 changed files with 1577 additions and 66 deletions
+8 -1
View File
@@ -4,6 +4,8 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using MediatR;
using mws.backend.dotnet.application.Audit;
using mws.backend.dotnet.application.Auth;
using mws.backend.dotnet.application.Common;
using mws.backend.dotnet.application.Documents;
@@ -25,7 +27,12 @@ public static class DependencyInjection
services.AddScoped<IUnitOfWork, UnitOfWork>();
services.AddAutoMapper(cfg => { }, typeof(MappingProfile).Assembly);
services.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(typeof(IUnitOfWork).Assembly));
services.AddMediatR(cfg =>
{
cfg.RegisterServicesFromAssembly(typeof(IUnitOfWork).Assembly);
cfg.AddOpenBehavior(typeof(AuditLogBehavior<,>));
});
services.AddScoped<IAuditContext, AuditContext>();
services.AddScoped<IPasswordHasher, BcryptPasswordHasher>();