public async Task <OneOf <NotFound, Success> > Handle(OnboardProviderCommand request, CancellationToken cancellationToken) { var result = await _cosmosDbQueryDispatcher.ExecuteQuery(new UpdateProviderOnboarded { ProviderId = request.ProviderId, UpdatedBy = _currentUserProvider.GetCurrentUser(), UpdatedDateTime = _clock.UtcNow.ToLocalTime() }); return(result.Match <OneOf <NotFound, Success> >( notFound => notFound, _ => new Success(), success => success)); }
public Task <IActionResult> OnboardProvider(OnboardProviderCommand request) => _mediator.SendAndMapResponse( request, result => result.Match <IActionResult>( _ => NotFound(), _ => RedirectToAction("Index", "ProviderDashboard", new { providerId = request.ProviderId })));