autobus-api_old/AutobusApi.Application/Identity/Commands/Register/RegisterCommandHandler.cs
2023-11-15 19:00:34 +02:00

22 lines
601 B
C#

using AutobusApi.Application.Common.Interfaces;
using MediatR;
namespace AutobusApi.Application.Identity.Commands.Register;
public class RegisterCommandHandler : IRequestHandler<RegisterCommand>
{
private readonly IIdentityService _identityService;
public RegisterCommandHandler(IIdentityService identityService)
{
_identityService = identityService;
}
public async Task Handle(
RegisterCommand command,
CancellationToken cancellationToken)
{
await _identityService.RegisterAsync(command.Email, command.Password, cancellationToken);
}
}