femto-backend/Femto.Common/Infrastructure/DomainServiceExtensions.cs
2025-06-16 21:11:40 +02:00

19 lines
No EOL
548 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(DDDPipelineBehaviour<,>)
);
}
}