As an example:
I have a data transfer object mapped from my business entity.
I have a Controller, that calls business logic handler
class, that returns List<MyDTO> result
.
Can I have List<MyDTO>
as a public member in my ViewModel
so that I can load List<MyDTO> result
into my ViewModel
, and afterwards use foreach
and so on from my View
, and take data from List in ViewModel to show it in a View?
Or should DTO be used ONLY for transfer, not as a ViewModel
public member?