zeroframework/Services/DeviceCenter/ZeroFramework.DeviceCenter.Domain/DependencyRegistrar.cs

25 lines
1.0 KiB
C#
Raw Normal View History

2023-12-05 09:22:48 +00:00
using Microsoft.Extensions.DependencyInjection;
using System.ComponentModel;
using ZeroFramework.DeviceCenter.Domain.Aggregates.DeviceAggregate;
using ZeroFramework.DeviceCenter.Domain.Aggregates.TenantAggregate;
using ZeroFramework.DeviceCenter.Domain.Services.Devices;
using ZeroFramework.DeviceCenter.Domain.Services.Ordering;
namespace ZeroFramework.DeviceCenter.Domain
{
public static class DependencyRegistrar
{
public static IServiceCollection AddDomainLayer(this IServiceCollection services)
{
services.AddTransient<IOrderDomainService, OrderDomainService>();
services.AddTransient<IDeviceGroupDomainService, DeviceGroupDomainService>();
services.AddSingleton<ICurrentTenantAccessor, CurrentTenantAccessor>();
services.AddTransient<ICurrentTenant, CurrentTenant>();
TypeDescriptor.AddAttributes(typeof(GeoCoordinate), new TypeConverterAttribute(typeof(GeoCoordinateTypeConverter)));
return services;
}
}
}