tags:

views:

82

answers:

4

Where do you put non-controller, non-model code, like util classes, extension methods and so on in a ASP.Net MVC project? Maybe there's not a specific place to put it, you just put it anywhere, if so, any recommendation? Any best practices?

A: 

My recommendation is to put them where they are used most. So if it is the controller that uses them put it with the controller, and so on.

Tamar
+1  A: 

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

xandy
+1  A: 

if it's a single class i put them in a "Library" folder on the project root. If it's a bit bigger I use a specific folder and if it's something more complex i create a new project in the same solution.

Drevak
+1  A: 

Good references for ASP.NET MVC Best Practice

http://weblogs.asp.net/rashid/archive/2009/04/01/asp-net-mvc-best-practices-part-1.aspx

http://weblogs.asp.net/rashid/archive/2009/04/03/asp-net-mvc-best-practices-part-2.aspx

hadi teo
They are interesting posts, but I can't really find the answer to my question there.
J. Pablo Fernández