femto-backend/Femto.Common/Infrastructure/DomainServiceExtensions.cs
2025-05-16 16:10:01 +02:00

19 lines
No EOL
556 B
C#

using MediatR;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
namespace Femto.Common.Infrastructure;
public static class DomainServiceExtensions
{
public static void ConfigureDomainServices<TContext>(this IServiceCollection services)
where TContext : DbContext
{
services.AddScoped<DbContext>(s => s.GetRequiredService<TContext>());
services.AddTransient(
typeof(IPipelineBehavior<,>),
typeof(SaveChangesPipelineBehaviour<,>)
);
}
}