How are you populating/validating your ViewModels?

后端 未结 4 364
闹比i
闹比i 2021-01-30 03:40

I\'m curious of all of the various ways people are building their ViewModels and why they choose that method.

I can think of several ways here:

-1. Injected repo

4条回答
  •  借酒劲吻你
    2021-01-30 04:02

    I use a service layer that hides the domain model from the controller returning ViewModels from the service methods. This allows me to make changes to the domain model without impacting the client.

提交回复
热议问题