newmanth
newmanth

Reputation: 408

ASP.NET MVC ViewModel Path

When creating a new ASP.NET MVC 3 project, there is no pre-created directory for storing ViewModel objects (presumably because this is an optional pattern). I know the location is arbitrary, but is there a generally accepted path where these should be placed?

Upvotes: 0

Views: 314

Answers (2)

Juan Ayala
Juan Ayala

Reputation: 3518

In the Model folder. This folder should contain view models. Domain models or entity models should be part of another assembly, i.e. a data access layer assembly. Same for DTOs.

Upvotes: 1

Massimiliano Peluso
Massimiliano Peluso

Reputation: 26737

Usually the ViewModels should be in the same project of the Views but it is arbitrary

enter image description here

Upvotes: 1

Related Questions