public IActionResult Details(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var consumo = _mapper.Map <ConsumoViewModel>(_consumoRepository.GetById(id.Value));

            if (consumo == null)
            {
                return(NotFound());
            }

            return(View(consumo));
        }
Exemple #2
0
 public RedirectToActionResult Create(Restaurante entity)
 {
     entity.consumo = consumoRepository.GetById(entity.consumo.id);
     restauranteRepository.Create(entity);
     return(RedirectToAction("Index"));
 }
Exemple #3
0
 public IActionResult View(int id)
 {
     return(View(consumoRepository.GetById(id)));
 }