19 lines
572 B
C#
19 lines
572 B
C#
|
using CH.CQRS.Service.Energy;
|
||
|
using OpenHarbor.CQRS.Abstractions;
|
||
|
|
||
|
namespace CH.CQRS.Command.Energy;
|
||
|
|
||
|
public class EnableEnergyRateCommand
|
||
|
{
|
||
|
public long RateId { get; set; }
|
||
|
}
|
||
|
public class EnableEnergyRateCommandHandler(EnergyService energyService) : ICommandHandler<EnableEnergyRateCommand>
|
||
|
{
|
||
|
public Task HandleAsync(EnableEnergyRateCommand command, CancellationToken cancellationToken = new CancellationToken())
|
||
|
{
|
||
|
return energyService.EnableEnergyRateAsync(new EnableEnergyRateCommandOptions
|
||
|
{
|
||
|
RateId = command.RateId
|
||
|
}, cancellationToken);
|
||
|
}
|
||
|
}
|