In this and next posts we will discuss a topic that is not clear to most developers. How to create queries to data source based on the view settings? The settings can be quite a lot. These include pagging, sorting, filtering, etc. For applications developed by DDD methodology (will not be shy now it is popular enough) it all comes down to the correct query to a repository and getting of an answer in the correct form.