public async Task <string> Handle(RespondToInvitationCommand request, CancellationToken cancellationToken) { var invitation = await _invitationRepository.GetInvitationByIdAsync(request.InvitationId); _authorizationService.AuthorizeAccessOrThrow(_httpContextAccessor.HttpContext, invitation.UserId); if (request.Decision) { await UpdateGroupAsync(invitation); await UpdateUserAsync(invitation); } await _invitationRepository.DeleteInvitationAsync(invitation.Id); return(invitation.Id); }
public async Task Cleanup(string email, CancellationToken cancellationToken) { var invitation = await _invitationRepository.GetByEmailAsync(email, cancellationToken); await _invitationRepository.DeleteInvitationAsync(invitation.Id, cancellationToken); }