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
privatestaticIQuery<ContentItem,ContentItemIndex>OrderBy(IQuery<ContentItem,ContentItemIndex>query,IResolveFieldContextcontext){if(context.HasPopulatedArgument("orderBy")){varorderByArguments=JObject.FromObject(context.Arguments["orderBy"].Value);if(orderByArguments!=null){varthenBy=false;foreach(varpropertyinorderByArguments){// Maybe there's something wrong with this line in the source code// property.Value -> Descending// direction -> Ascendingvardirection=(OrderByDirection)property.Value.Value<int>();Expression<Func<ContentItemIndex,object>>selector=null;switch(property.Key){case"contentItemId":selector= x =>x.ContentItemId;break;case"contentItemVersionId":selector= x =>x.ContentItemVersionId;break;case"displayText":selector= x =>x.DisplayText;break;case"published":selector= x =>x.Published;break;case"latest":selector= x =>x.Latest;break;case"createdUtc":selector= x =>x.CreatedUtc;break;case"modifiedUtc":selector= x =>x.ModifiedUtc;break;case"publishedUtc":selector= x =>x.PublishedUtc;break;case"owner":selector= x =>x.Owner;break;case"author":selector= x =>x.Author;break;}if(selector!=null){if(!thenBy){query=direction==OrderByDirection.Ascending?query.OrderBy(selector):query.OrderByDescending(selector);}else{query=direction==OrderByDirection.Ascending?query.ThenBy(selector):query.ThenByDescending(selector);}thenBy=true;}}}}else{query=query.OrderByDescending(x =>x.CreatedUtc);}returnquery;}
The text was updated successfully, but these errors were encountered:
Thank you for submitting your first issue, awesome! 🚀 We're thrilled to receive your input. If you haven't completed the template yet, please take a moment to do so. This ensures that we fully understand your feature request or bug report. On what happens next, see the docs.
If you like Orchard Core, please star our repo and join our community channels.
I set createdUtc to DESC, but the sorting is not correct.
In the source
The text was updated successfully, but these errors were encountered: