public async Task <IActionResult> Create(int guestReservationId) { ViewData["ItemOfProducts"] = await _repository.GetItemOfProducts(); ViewBag.guestReservationId = guestReservationId; var JobNotablesNormal = await _repository.GetJobNotablesNormal(guestReservationId); var JobNotablesNotNormal = await _repository.GetJobNotablesNotNormal(guestReservationId); ViewBag.notableNormal = JobNotablesNormal.Count(); ViewBag.notableNotNormal = JobNotablesNotNormal.Count(); var giftsall = await _repository.GetGiftsByGuestReservationId(guestReservationId); if (giftsall.Count() > 0) { return(View(giftsall.OrderBy(f => f.ItemOfProductId).ToList())); } return(View()); }