I am using 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 am creating a method that I want to use instead of checking id:
bool AreNear(string Adress, object Adress)
I would like to use this method
string adress = "...";
var item = context.MyTable.Where(i => AreNear(i.adress,adress) ).Single();
but I get an error on execution saying that I canβt use the method in my request, is there a way to make it work?
source
share