linq and contains

Posted by kusanagi on Stack Overflow See other posts from Stack Overflow or by kusanagi
Published on 2010-05-19T10:29:46Z Indexed on 2010/05/19 10:40 UTC
Read the original article Hit count: 216

Filed under:
|
|
|

i have func

public PageOfList<ConsaltQuestion> Filter(int? type, int pageId, EntityCollection<ConsaltCost> ConsaltRoles)
    {
       // return _dataContext.ConsaltQuestion.Where((o => o.Type == type || type == null) && (o=>o.Paid == paid));
        return (from i in _dataContext.ConsaltQuestion where ((i.Type == type || type == null) && (i.Paid == true) && (ConsaltRoles.Contains(ConsaltCostDetails(i.Type.Value)))) select i).ToList().ToPageOfList(pageId, 20);
    }

it return error

LINQ to Entities does not recognize the method 'Boolean Contains(mrhome.Models.ConsaltCost)' method, and this method cannot be translated into a store expression.

how can i fix it?

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about contains