'long'不包含'Contains'的定义和最佳扩展方法重载'Queryable.Contains <long>(IQueryable <long>,long)'

时间:2019-10-18 07:15:16

标签: model-view-controller filter visual-studio-2017

s => s.CollectionIDFK。包含此错误,因为我想添加一个过滤器并让用户键入所需的CollectionIDFK id,程序将显示相关记录。

public ActionResult Index(string id)    
    {     
        var rugs = from s in db.Rugs    
                   select s;    
        if (!String.IsNullOrEmpty(id))
        {
            rugs = rugs.Where(s => s.CollectionIDFK.Contains(s.CollectionIDFK));
        }
        return View(rugs.ToList());
    }

0 个答案:

没有答案