I use EntityFramework with POCOs.
Suppose I have POCOs defined like this (simplified):
class Class1
{
public int ID;
public int SomeNumber;
}
class
IMHO you should be OK with just this:
Database DB = new Database();
var result = DB.SomeClass.Where(x =>
Number == x.Class1.SomeNumber ||
Number == x.Class2.SomeNumber ||
Number == x.Class3.SomeNumber)
.ToList();
Your query loads all data and after that you evaluate condition in .NET = you must test null value prior to accessing SomeNumber
but that is not needed if you evaluate SomeNumber
in SQL through Linq-to-entities. Linq-to-entities should perform automatic null coalescing.