I use linq to access a table from my DB using Entity Framework
MyDBEntities context = new MyDBEntities;
int id = 111;
var item = context.MyTable.Where(i => i.id == id).Single();
This works fine but now I create a method I wish to use instead of the id check:
bool AreNear(string Adress, object Adress)
I'd like to use that way
string adress = "...";
var item = context.MyTable.Where(i => AreNear(i.adress,adress) ).Single();
but I get an error at the execution saying I can't use the method in my query is there a way to make it work?