stuff
This commit is contained in:
parent
14fd359ea8
commit
a4ef2b4a20
26 changed files with 331 additions and 78 deletions
19
Femto.Common/Infrastructure/DomainServiceExtensions.cs
Normal file
19
Femto.Common/Infrastructure/DomainServiceExtensions.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
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<,>)
|
||||
);
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue