Skip to content

Conversation

@bart-degreed
Copy link
Contributor

Fixes the problem described at #741 (comment).

The issue is that the specified expression gets wrapped in a type conversion expression on non-string properties, making the code unable to 'see' through the single field.

Unfortunately this code is shared between GetDefaultSortOrder and HideFields, making it possible to specify multiple fields in a single ordering (which makes no sense at all).

@bart-degreed
Copy link
Contributor Author

@fdlane does this solve your issue?

@fdlane
Copy link
Contributor

fdlane commented May 14, 2020

@bart-degreed the non-string properties now sort with correctly. Thank you!

      public override PropertySortOrder GetDefaultSortOrder() => new PropertySortOrder
      {
        (t => t.InvoiceDate, SortDirection.Descending)
      };

@bart-degreed bart-degreed merged commit 87f05f2 into json-api-dotnet:master May 14, 2020
@bart-degreed bart-degreed deleted the default-sort-type-conversion branch May 14, 2020 13:35
@bart-degreed bart-degreed mentioned this pull request May 18, 2020
38 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants