From 2c152d9eb8f121f4e89a0bfe36a55f50ab5edf7c Mon Sep 17 00:00:00 2001 From: Paul Welter Date: Mon, 25 Mar 2024 16:15:47 -0500 Subject: [PATCH] fix audit bug --- src/MediatR.CommandQuery.Audit/AuditServiceExtensions.cs | 5 +++++ .../MediatR.CommandQuery.Audit.csproj | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/MediatR.CommandQuery.Audit/AuditServiceExtensions.cs b/src/MediatR.CommandQuery.Audit/AuditServiceExtensions.cs index 257044d7..118aed89 100644 --- a/src/MediatR.CommandQuery.Audit/AuditServiceExtensions.cs +++ b/src/MediatR.CommandQuery.Audit/AuditServiceExtensions.cs @@ -1,3 +1,5 @@ +using EntityChange; + using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; @@ -10,6 +12,9 @@ public static IServiceCollection AddEntityAudit(this IServiceCollection services if (services is null) throw new ArgumentNullException(nameof(services)); + services.TryAddSingleton(sp => new EntityConfiguration(sp.GetServices())); + services.TryAddSingleton(sp => new EntityComparer(sp.GetRequiredService())); + services.TryAddSingleton(typeof(IChangeCollector<,>), typeof(ChangeCollector<,>)); return services; diff --git a/src/MediatR.CommandQuery.Audit/MediatR.CommandQuery.Audit.csproj b/src/MediatR.CommandQuery.Audit/MediatR.CommandQuery.Audit.csproj index e34a966e..9bf171eb 100644 --- a/src/MediatR.CommandQuery.Audit/MediatR.CommandQuery.Audit.csproj +++ b/src/MediatR.CommandQuery.Audit/MediatR.CommandQuery.Audit.csproj @@ -7,7 +7,7 @@ - +