| 12345678910111213141516171819202122 |
- using Microsoft.Extensions.DependencyInjection;
- using Quadarax.Foundation.Core.Data.Domain;
- using Quadarax.Foundation.Core.Data.Interface.Domain;
- using Quadarax.Foundation.Core.Data.Mapper;
- namespace Quadarax.Foundation.Core.Business.Injection.Extensions
- {
- public static class ServiceCollectionExt
- {
- public static IServiceCollection AddDataDomain(this IServiceCollection services)
- {
- services.AddScoped<IDomainContextResolver<DataDomain>, DomainContextResolver<DataDomain>>();
- services.AddScoped<IUnitOfWork<DataDomain>, UnitOfWorkDataDomain>();
- return services;
- }
- public static IServiceCollection AddMapper<TMapper>(this IServiceCollection services) where TMapper : Mapper<TMapper>, new()
- {
- return services.AddSingleton<TMapper>();
- }
- }
- }
|