ASP.Net MVC Architecture - Location ViewModels

We have a decent MVC project that works well at the moment, I started looking at some re-factoring, and I have a question.

Currently, the data level and service level are stored in a separate class library. Controllers load data objects (generated from linq2sql) from the service level, which performs any logical check, and then converts them to viewmodels (using Auto-Mapper).

Instead, should ViewModels be returned directly from the service?

+3
source share
2 answers

Definitely not!

ViewModel "" - . , , , , ...

+4

, . , , -. , -. MVC, , . , , "" -. , .

+2

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


All Articles