Exemple #1
0
 public async Task Atualizar(Item entity)
 {
     //Validar
     if (!ExecutarValidacao(new ItemValidation(), entity))
     {
         return;
     }
     //Executar
     await _itemRepository.Atualizar(entity);
 }
Exemple #2
0
        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"));
        }