I have the following query:
var query = (from e in conn.equipments
select new
{
id = e.id,
status = GetEquipmentStatusText(e.status)
}).ToList();
public static string GetEquipmentStatusText(int status) {
return (status == 1) ? "Active" : "Not Active";
}
This results in the error:LINQ to Entities does not recognize the method
How do I fix it in a way that the "GetEquipmentStatusText" can be centralized into a method where it can be called in other LINQ queries?