public IActionResult Create(ConsumoViewModel consumoViewModel) { if (ModelState.IsValid) { var consumo = _mapper.Map <Consumo>(consumoViewModel); _consumoRepository.Add(consumo); _uow.SaveChanges(); return(RedirectToAction(nameof(Index))); } return(View(consumoViewModel)); }