I want to use expression trees to make filters with entity framework.
So this is my types
public class Type1
{
public string Name { get; set; }
}
public class Type2
{
public IEnumerable<string> Names { get; set; }
}
and this is my specification
public Expression<Func<Entities.Type1, bool>> MyExpression(Type2 filter)
{
//something like where name in (name[0], name[1], ... name[n])
}
I need transform this in something like Sql where in.
How can I do it, and what's the best form?
How can I make Entity Framework understand my arbitrary expression in the way I want?