public ActionResult <Marca> Put([FromBody] Marca marca) { var _marca = _marcaService.Atualizar(marca); if (_marca != null) { return(Ok(_marca)); } else { return(NoContent()); } }
public async Task <IActionResult> Edit(Guid id, MarcaViewModel marcaViewModel) { if (id != marcaViewModel.Id) { return(NotFound()); } if (!ModelState.IsValid) { return(View(marcaViewModel)); } var marca = _mapper.Map <Marca>(marcaViewModel); await _marcaService.Atualizar(marca); return(View(_mapper.Map <MarcaViewModel>(await _marcaRepository.ObterPorId(id)))); }
public async Task <Marca> Edit(Guid id, Marca marca) { await _marcaService.Atualizar(marca); return(await _marcaRepository.ObterPorId(id)); }