private async Task <ProductViewModel> GetProduct(Guid id) { var product = _mapper.Map <ProductViewModel>(await _repo.GetProductAndCaterer(id)); product.Caterers = _mapper.Map <IEnumerable <CatererViewModel> >(await _repoCaterer.GetAll()); return(product); }
public async Task <IActionResult> Index() { var model = _mapper.Map <IEnumerable <CatererViewModel> >(await _repo.GetAll()); return(View(model)); }