public IActionResult Put(int id, [FromBody] LocalResquestDto localDto) { var local = MapearLocalRequestDtoParaLocal(localDto); localRepositorio.AtualizarLocal(id, local); contexto.SaveChanges(); return(Ok("Registro alterado")); }
public IActionResult Put(int id, [FromBody] LocalDto localRequest) { var local = MapearParaDominio(localRequest); var mensagens = localService.Validar(local); if (mensagens.Count() > 0) { return(BadRequest(mensagens)); } localRepository.AtualizarLocal(id, local); contexto.SaveChanges(); return(Ok()); }