mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-06-29 18:21:08 +00:00
25 lines
895 B
C#
25 lines
895 B
C#
using CleanArchitecture.Domain.Interfaces;
|
|
using CleanArchitecture.Domain.Interfaces.Repositories;
|
|
using CleanArchitecture.Domain.Notifications;
|
|
using CleanArchitecture.Infrastructure.Database;
|
|
using CleanArchitecture.Infrastructure.Repositories;
|
|
using MediatR;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace CleanArchitecture.Infrastructure.Extensions;
|
|
|
|
public static class ServiceCollectionExtensions
|
|
{
|
|
public static IServiceCollection AddInfrastructure(this IServiceCollection services)
|
|
{
|
|
// Core Infra
|
|
services.AddScoped<IUnitOfWork, UnitOfWork<ApplicationDbContext>>();
|
|
services.AddScoped<INotificationHandler<DomainNotification>, DomainNotificationHandler>();
|
|
services.AddScoped<IMediatorHandler, InMemoryBus>();
|
|
|
|
// Repositories
|
|
services.AddScoped<IUserRepository, UserRepository>();
|
|
|
|
return services;
|
|
}
|
|
} |