public Task <long> UpdateUnidadeInfraEstrutura(UpdateUnidadeInfraEstruturaCommand command) { var requestUrl = CreateRequestUri(string.Format(System.Globalization.CultureInfo.InvariantCulture, $"{ResourceUnidadeInfraEstrutura}/UpdateUnidadeInfraEstrutura")); return(Post(requestUrl, command)); }
public async Task <ActionResult <bool> > UpdateUnidadeInfraEstrutura(UpdateUnidadeInfraEstruturaCommand command) { try { var result = await Mediator.Send(command); return(result); } catch (Exception e) { Console.WriteLine(e); throw; } }
public ActionResult Edit(int id, IFormCollection collection) { try { var command = new UpdateUnidadeInfraEstruturaCommand { CodUnidadeInfraestrutura = id, Descricao = collection["Descricao"].ToString(), DtIniVigencia = collection["DtIniVigencia"].ToString(), DtFimVigencia = collection["DtFimVigencia"].ToString(), AlteradorPor = User.Identity.Name }; ApiClientFactory.Instance.UpdateUnidadeInfraEstrutura(command); return(RedirectToAction(nameof(Index), new { crud = (int)EnumCrud.Updated })); } catch { return(View()); } }