Where do you put uncontrolled, non-model code in an ASP.Net MVC project?

Where you put the non-controller, non-model code, for example, usage classes, extension methods, etc. in an ASP.Net MVC project? Maybe there is no specific place, you just put it anywhere, if so, then any recommendations? Any best practices?

+4
source share
5 answers

if it is one class, I put them in the Library folder in the root of the project. If it is a little larger, I use a specific folder, and if it is something more complex, I create a new project in the same solution.

+2
source

According to the Kigg Sample MVC web project (you can get it from the official ASP.net), they put utility classes with a subfolder under root.

+1
source

My recommendation is to place them where they are most used. So if this is the controller that uses them, put it with the controller, etc.

0
source

App_Code is for this purpose if I am not mistaken.

Everything that is stored here (including in subfolders) will be available throughout the application.

In VS2015 Community (maybe others, but I have not tested it yet) this is even in the context menu under Add -> Add ASP.NET Folder -> App_Code along with several others.

0
source

All Articles