Is it possible to use orderby virtual properties for an object?
I have a class similar to:
public int Id{get;set;} public string Name {get;set;} public virtual string TestName { get { return string.Format("{0}{1}", Name , Id); } }
When I order the TestName property, I get an error:
"The specified member of type 'TestName' is not supported in LINQ to Entities. Only initializers, entities, and property entities are supported."
Initially, I had a method in a partial class, the property is used to return data, but not for ordering.
Is there any way around this?
source share