It must go into the Models directory of the web application. ViewModels, by definition, refer to one or more views and therefore belong to a web application, not to the kernel.
You can define them in the controller that uses them, but this does not scale. Same thing with class definition in view code. Despite the fact that one class for files means more files, it is easier to find the code and simplify its support.
I often create a subfolder for each controller, so I get things like Web.Models.Foo.BarViewModel .
source
share