public async Task Atualizar(Item entity) { //Validar if (!ExecutarValidacao(new ItemValidation(), entity)) { return; } //Executar await _itemRepository.Atualizar(entity); }
public async Task <IActionResult> Edit(Guid id, ItemViewModel itemViewModel) { if (id != itemViewModel.Id) { return(NotFound()); } if (!ModelState.IsValid) { return(View(itemViewModel)); } var item = _mapper.Map <Item>(itemViewModel); await _contexto.Atualizar(item); return(RedirectToAction("Index")); }