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)); }
public RedirectToActionResult Create(Restaurante entity) { entity.consumo = consumoRepository.GetById(entity.consumo.id); restauranteRepository.Create(entity); return(RedirectToAction("Index")); }
public IActionResult View(int id) { return(View(consumoRepository.GetById(id))); }