AspNetCoreOData icon indicating copy to clipboard operation
AspNetCoreOData copied to clipboard

Not possible to set sortability/filterable on navigationproperties properties

Open davhdavh opened this issue 2 years ago • 2 comments

  • AddSortRestrictionsAnnotation only looks for entityTypeConfig.Properties.Where(property => property.Unsortable), it does not see if a property is navigatable and check properties for there and build a proper path.
  • SetSortRestrictionsAnnotation is internal, therefore it is impossible to easily use it Similar with filterable

davhdavh avatar Mar 04 '22 09:03 davhdavh

@davhdavh Could you please clarify this statement "it does not see if a property is navigatable and check properties for there and build a proper path"?

gathogojr avatar Mar 08 '22 17:03 gathogojr

We are talking about Microsoft.OData.ModelBuilder.Helpers.EdmModelHelperMethods.AddSortRestrictionsAnnotation and AddFilterRestrictionsAnnotation, which should recursively visit all entity types to find their nonsort (and nonfilterable) properties to some configurable depth.

davhdavh avatar Mar 09 '22 04:03 davhdavh