public async Task <IActionResult> PutAsync(PaymentSourceInputModel model) { if (ModelState.IsValid) { var result = await commands.SendAsync(model.ToChangeNameCommand()); if (result.IsSuccess) { return(NoContent()); } return(StatusCode(500, result.Error)); } return(BadRequest(ModelState)); }
public async Task <IActionResult> PostAsync(PaymentSourceInputModel model) { if (ModelState.IsValid) { var result = await commands.SendAsync(model.ToAddCommand()); if (result.IsSuccess) { return(Created(Url.Action("Get", new { id = model.Id }), null)); } return(StatusCode(500, result.Error)); } return(BadRequest(ModelState)); }