Where should I place additional classes in my MVC application?
I have an ASP.NET MVC application that uses the Linq to SQL classes placed in the Model folder.
I want to create some additional classes that I would normally place in my BLL, but I'm not sure how to work with MVC.
In WebForms, I will have DAL as class library. My BLL is like a class library that referenced my BLL. My website is referenced by both DAL and BLL.
The problem I am facing is that if I create a class library, this will have to reference my MVC app because it will need to use the types contained in my model.
If I then add (or try to add) a link to my class library, I end up with a circular dependency.
In web forms. My other option would be to place the classes in App_Code. Is there an equivalent to App_Code in an MVC app?
a source to share
You can put this in the model folder. Since all business related classes are placed in this folder
For best practice see scottgu nerddinner . He created breathing classes in the nerdinner app.
a source to share
I agree with the Model folder . You can arrange it for your heart (BLL, DAL, etc.).
I personally would avoid doing a separate build unless you have a good reason. I am a developer who tends to complicate problems too much, if I am not careful I try to follow the KISS (Keep It Simple Stupid) methods as much as possible, which usually does not allow me to get rid of a certain problem.
a source to share