I am trying to create a simple LINQ query like this:
var query = from o in entities.Orders
select new Order
{
Firstname = o.FirstName,
Lastname = GetName()
};
Here I want FirstName to be obtained from database, and I want to supply the Lastname from another source. When I run this I get an exception: "LINQ to Entities does not recognize the method 'System.String GetName()' method, and this method cannot be translated into a store expression."
How can I add my own methods to a LINQ query?