C # Data Access GetAll () methods with many parameters

Typically, for a data access layer, the following methods exist:

    Tuple<int, IList<Media>> GetAllWithFilter(int? page, string folderName, string title, string fileName, string author, string keywordTitle, int type, int fileType, int rowsPerPage, Guid keywordId, string sortField = null, string sortDir = null);

And it gets messy and messy every time a new property is added

What are good methods to make these methods readable and maintainable?

thank

+3
source share
2 answers

Why not create an object that stores all of your filter properties and just pass it on?

+4
source

I think that would help. Request Template

+2
source

Source: https://habr.com/ru/post/1784665/


All Articles