Search code examples
visual-studio-2010asp.net-mvc-3service-layerdirectory-structure

In a ASP.NET MVC3 under which folder shall I place my Service layer?


The question is quite straightforward.

In my MVC3 application I have an architecture with Repository and Service layers, with the Repository exposing its methods to the Service layer and the Service layer exposing its methods to the Controller.

The Service layer is a class called MyServices that implements a IMyServices interface.

In a typical Visual Studio MVC3 folder organization where would you place MyServices and IMyServices?


Solution

  • There's no rule for that. A Services folder seems logical. Or if you are writing a reusable service layer you might put that into a separate class library which you would reference in your ASP.NET MVC application.