1
I have a list of objects and would like to search 2 properties of that list in the database. with a list of primitive types I would do so:
(from n in db.Tabela
where listaPrimitivos.Contains(n.propriedade)
select n)
I thought how to search the list of objects in SQL:
SQL = "Select * from Tabela where 1!=1"
for(int i = 0; i < listaObjetos.Count; i++){
SQL += " or (Tabela.prop1 = " + listaObjetos.prop1
SQL += " and Tabela.prop2 = " + listaObjetos.prop2 + ") "
}
How can I make this same query using the Entity Framework?
turn the two properties on your list into primitive type lists. :)
– Marco Souza