In oracle, I can make the following request:
SELECT * FROM Tabl Tabb WHERE (tabb.Col1, tabb.Col2) IN ( (1,2), (3,4))
Suppose I have the following entity:
public class Tabb { public int Col1 {get; set; } public int Col2 {get; set; }
and criteria class
public class Search { public int Col1 {get; set; } public int Col2 {get; set; } }
I need to write:
public IEnumerable<Tabb> Select(IEnumerable<Search> s) { var queryable = this.context.Tabbs; return queryable.Where(\* some *\).ToList(); }
How can I select the objects in this search collection contains a search instance with the same value Col1 and Col2 ?
EDIT
var result = from x in entity join y in entity2 on new { x.field1, x.field2 } equals new { y.field1, y.field2 }
This does not work (as I expected) - in the case case, entity2 not an entity table, it is a static collection, so EF throws an exception (sth like: cannot find a display layer for type Search []);
c # linq entity-framework
user2160375
source share