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 @@ - +