ReflectionIT.Mvc.Paging icon indicating copy to clipboard operation
ReflectionIT.Mvc.Paging copied to clipboard

Case insensitive sort expression

Open poganytamas opened this issue 5 years ago • 0 comments

Your code is using property names as strings for sort expression. This leads to a problem using JavaScript frameworks. Usually when using JSON serializer in MVC core, properties gets camel cased, so eg. ServerId becomes serverId. When I set up for example a vuetify data table, I have to specify header properties: serverId, serverName... When I sort the table, and send back the code, it will search for serverId property, but there is none, there is only ServerId. Of course I could change the JSON serializer, but that would lead to an unusual / weird JavaScript code.

I kindly suggest to change GetPropertyInfo in LinqExtensions.cs so instead of direct name match p.Name == name, it should be case insensitive comparison.

poganytamas avatar Oct 15 '19 10:10 poganytamas