public async Task <CateringDetailModel> GetSingleCateringDetails([FromRoute] int cateringId) { Catering catering = await cateringDbContext.Caterings .Include(x => x.CateringEmployees) .ThenInclude(x => x.User) .Include(x => x.CateringDishes) .ThenInclude(x => x.Dish) .ThenInclude(x => x.DishType) .Include(x => x.Vehicle) .FirstOrDefaultAsync(x => x.CateringId == cateringId); CateringDetailModel model = catering.GetCateringDetailModel(); return(model); }
public async Task <IActionResult> GetCateringDetailPartialView([FromRoute] int cateringId) { Catering catering = await cateringDbContext.Caterings .Include(x => x.CateringEmployees) .ThenInclude(x => x.User) .Include(x => x.CateringDishes) .ThenInclude(x => x.Dish) .ThenInclude(x => x.DishType) .Include(x => x.Vehicle) .FirstOrDefaultAsync(x => x.CateringId == cateringId); CateringDetailModel model = catering.GetCateringDetailModel(); string viewPath = @"\Views\Caterings\_CateringDetailModalContentPartial.cshtml"; return(PartialView(viewPath, model)); }