You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorting by an interface member from a lambda expression fails in v5.0.1. It was working before in v4.2.0.
It is beneficial to implement common sorting logic in a generic resource definition.
STEPS TO REPRODUCE
The following example code is based on your GettingStarted example. A generic resource definition that supports sorting for all models that implement an ISortable interface.
{
"id": "5a2eb44b-35d7-4e5c-9299-25e5ad1cf1ef",
"status": "500",
"title": "Invalid lambda expression for sorting from resource definition. It should select a property that is exposed as an attribute, or a to-many relationship followed by Count(). The property can be preceded by a path of to-one relationships. Examples: 'blog => blog.Title', 'blog => blog.Posts.Count', 'blog => blog.Author.Name.LastName'.",
"detail": "The lambda expression 'resource => Convert(resource.SortOrder, Object)' is invalid. Type 'GettingStarted.Models.ISortable' does not exist in the resource graph."
}
DESCRIPTION
Sorting by an interface member from a lambda expression fails in v5.0.1. It was working before in v4.2.0.
It is beneficial to implement common sorting logic in a generic resource definition.
STEPS TO REPRODUCE
The following example code is based on your GettingStarted example. A generic resource definition that supports sorting for all models that implement an ISortable interface.
EXPECTED BEHAVIOR
It should return an ordered collection by the property SortOrder.
ACTUAL BEHAVIOR
It raises an exception in SortExpressionLambdaConverter.cs:
Possible solution
VERSIONS USED
The text was updated successfully, but these errors were encountered: