public async Task <IActionResult> Detail(int labID) { Laboratory labDetail = LabDB.GetByID(labID); List <ItemDetail> itemDetails = await ItemDB.GetAllDetailByLabIDAsync(labID); List <int> itemSet = await ItemDB.GetItemSetByLabIDAsync(labID); List <int> itemQuantity = await ItemDB.GetAllQuantityByLabIDAsync(labID); itemDetails.ForEach(item => { if (!itemSet.Contains(item.type)) { itemSet.Add(item.type); } }); ViewData["LabDetail"] = labDetail; ViewData["ItemSet"] = itemSet; ViewData["ItemQuantity"] = itemQuantity; ViewData["LabID"] = labID; return(View()); }