How to structure query functions in services
I have the following function in my service layer csharp:
PS: A category can have List<Item>
Sometimes I need
But also sometimes I need
I'm thinking of having two functions with two separate dtos (one has only the category, the other one has the category + the items).
But I was wondering if there's a better way to do this
PS: A category can have List<Item>
Sometimes I need
GetCategories() to just be the Category without any navigation properties included.But also sometimes I need
GetCategories() to also include the Items navigation property...I'm thinking of having two functions with two separate dtos (one has only the category, the other one has the category + the items).
But I was wondering if there's a better way to do this