public async Task <IActionResult> Post( EditProviderType.Command command, ProviderContext providerContext) { command.ProviderId = providerContext.ProviderInfo.ProviderId; return(await _mediator.SendAndMapResponse( command, response => response.Match <IActionResult>( errors => this.ViewFromErrors("EditProviderType", errors), success => RedirectToAction("ProviderDetails", "Providers").WithProviderContext(providerContext)))); }
public async Task <IActionResult> Post(EditProviderType.Command command) { if (command.ProviderId != _providerContext.ProviderInfo.ProviderId) { return(BadRequest()); } return(await _mediator.SendAndMapResponse( command, response => response.Match <IActionResult>( errors => this.ViewFromErrors("EditProviderType", errors), confirmErrors => this.ViewFromErrors("EditProviderTypeConfirm", confirmErrors), confirm => View("EditProviderTypeConfirm", confirm), cancel => RedirectToAction(nameof(Get)).WithProviderContext(_providerContext), success => RedirectToAction("ProviderDetails", "Providers").WithProviderContext(_providerContext)))); }