constellation-api/CH.CQRS/Command/Energy/ServiceCollectionExtension.cs

43 lines
1.7 KiB
C#

using Microsoft.Extensions.DependencyInjection;
using OpenHarbor.CQRS.Abstractions;
using OpenHarbor.CQRS.FluentValidation;
namespace CH.CQRS.Command.Energy;
public static class ServiceCollectionExtension
{
public static IServiceCollection AddEnergyCommand(this IServiceCollection services)
{
services
.AddCommand<CreateEnergyProviderCommand, CreateEnergyProviderCommandHandler,
CreateEnergyProviderCommandValidator>();
services
.AddCommand<CreateEnergyRateCommand, CreateEnergyRateCommandHandler,
CreateEnergyRateCommandValidator>();
services
.AddCommand<CreateEnergyRateExceptionCommand, CreateEnergyRateExceptionCommandHandler,
CreateEnergyRateExceptionCommandValidator>();
services
.AddCommand<DisableEnergyProviderCommand, DisableEnergyProviderCommandHandler,
DisableEnergyProviderCommandValidator>();
services
.AddCommand<DisableEnergyRateCommand, DisableEnergyRateCommandHandler,
DisableEnergyRateCommandValidator>();
services
.AddCommand<EnableEnergyProviderCommand, EnableEnergyProviderCommandHandler,
EnableEnergyProviderCommandValidator>();
services
.AddCommand<EnableEnergyRateCommand, EnableEnergyRateCommandHandler,
EnableEnergyRateCommandValidator>();
services
.AddCommand<UpdateEnergyProviderCommand, UpdateEnergyProviderCommandHandler,
UpdateEnergyProviderCommandValidator>();
services
.AddCommand<UpdateEnergyRateCommand, UpdateEnergyRateCommandHandler,
UpdateEnergyRateCommandValidator>();
services
.AddCommand<UpdateEnergyRateExceptionCommand, UpdateEnergyRateExceptionCommandHandler,
UpdateEnergyRateExceptionCommandValidator>();
return services;
}
}