var item = Db.BuyFactorWithTag.Where(b =>
!b.IsSell && SearchUtility.SearchPersonByName(MR_SANAD_BASE , b.FK_Seller , input)).ToList();
public static bool SearchPersonByName(MrSanadBaseDb.Entities db, long? id, string input)
{
id = id ?? 0;
return db.Person.FirstOrDefault(p => p.PK_Person == id && !p.IsDeleted && p.FullName.Contains(input)) != null;
}
I have SearchByPersonName
in many places and turned it into a method, but Linq does not allow me to run it and gives me this error. How can I fix this error?
Error text
LINQ to Entities does not recognize the method 'Boolean SearchPersonByName(MrSanadBaseDb.Entities, System.Nullable`1[System.Int64], System.String)' method, and this method cannot be translated into a store expression.