autobus-api_old/AutobusApi.Application/Identity/Commands/Register/RegisterCommandHandler.cs

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 request,
CancellationToken cancellationToken)
{
await _identityService.RegisterAsync(request.Email, request.Password, cancellationToken);
}
}