'Advance filtering in HTTP GETs of ASP.NET web API
I'm currently learning how to create an API in ASP.NET web API (I'm using Visual Studio Community 2022 and .Net 6.0). I've been fiddling around with the HTTP GET and I came across the following question... how can I implement easily a dynamic and advanced filtering and sorting option?
For example, let’s say my model has the fields: ID, Name, Surname, Age, Date added. I want to be able to filter through any of those fields, and each field has their "special" querying option, for example, I can filter greater than in the date added field, but I can't do that in the name field.
Also, I want to be able to sort the data ascending or descending by a specific column or columns.
In other words, what approach should I follow to easily implement this filtering and sorting solution?
Thanks in advance! :D
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
