【发布时间】:2016-11-30 17:15:52
【问题描述】:
它显示代码的“不包含 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
标签: c# asp.net-mvc linq