它表示像错误“不包含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