它表示像錯誤「不包含ID定義」爲代碼不含定義爲「包含」
[HttpPost]
public ActionResult show(List<int> ids)
{
if (ids != null)
{
int[] brands = ids.ToArray();
var brandId = _db.Brands.Where(p => brands.Contains(p.ID));
var srtItems = _db.Products.Where(p => p.CategoryID == brandId.ID);
return PartialView("_pView", srtItems);
}
}
和以下代碼中的錯誤是不包含定義對於包含
[HttpPost]
public ActionResult show(List<int> ids)
{
if (ids != null)
{
int[] brands = ids.ToArray();
var brandId = _db.Brands.Where(p => brands.Contains(p.ID));
var sortItemss = _db.Products.Where(p => brandId.Contains(p.CategoryID));
return PartialView("_pView", srtItems);
}
請指引我
@diiN_肯定他,否則他將無法使用'Where' – user3185569