ASP.NET MVC 3 ViewModels in another project?

Is there anything from stopping the placement of ViewModels in another project?

I mainly have a DataModel project (Entity Framework), a Data Access project (can integrate it into a DataModel), business logic, and an ASP.NET MVC website. I want the Business Logic layer to return ViewModels, so I was wondering if they could be separated from the website code.

+3
source share
2 answers

Absolutely - you just need to reference the DLLs in the MVC3 project, and then reference these ViewModels in your strongly typed views.

Just make sure you announce

@model SeperateAssembly.ViewModelName

At the top of your views to make them strongly typed.

+3
source

Short answer: no

: . . , ..

, .

: -)

+1

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


All Articles