I am writing an API method to retrieve a list of objects, and I want to add pagination and a Contains
property as filters. I do not want to use AutoQuery.
What would be the best practice for implementing this functionality for long-term use?
- Should I define the filter properties directly in the request DTO?
- Should I create a class and add that class, like:
public class ListObjects : FilterRequest { }
- Should I use an interface and implement it?
The concern is that, at some point, there might be a need to separate the pagination logic and the Contains
field into different structure.