This question is locked. New answers and comments are not allowed.
I am using the [GridAction] attribute on a controller action to simplify paging and sorting. I am setting the .Data GridModel property to an IQueryable<Entity>. My entities are from Entity Framework.
I return a queryable from a repository in my domain, and then on the controller I project that result into a view model using linq's Select method.
The problem is, one of the properties I want to display on the grid is derived, so I'd like to assign a property on the GridModel to a custom method on my Entity partial class. However, when I do this, I get a runtime error:
"Only initializers, entity members, and entity navigation properties are supported."
Is there any (simple) way around this?
I return a queryable from a repository in my domain, and then on the controller I project that result into a view model using linq's Select method.
The problem is, one of the properties I want to display on the grid is derived, so I'd like to assign a property on the GridModel to a custom method on my Entity partial class. However, when I do this, I get a runtime error:
"Only initializers, entity members, and entity navigation properties are supported."
Is there any (simple) way around this?