December 2013 โ February 2014
This is an presentation for building scalable, extendable and easy to maintain project structure. It follows these practices/patterns:
- Loose coupling
- Single responsibility principle
- Dependency Injection
- Service layer pattern
- Repository pattern
It is based on my experience with architecting/extending/working on applications with such structures. The presentation is accompanied with basic solution, which shows the practices in action and which I use as template when I design projects based on these patterns.
English version: LooselyCoupledMVCStructure_EN.pdf
Bulgarian version: LooselyCoupledMVCStructure_BG.pdf
.NET, MVC, C#, Entity Framework - Code First, Ninject, Glimpse, Elmah
In order to open the solution you will need Visual Studio 2012 or greater. To run it, you will need also Microsoft SQL Server.
The application uses Code First approach with databases, which means that the database will be created on first run. But before that you need to configure the connection strings.
Locate in web.config and app.config the following lines:
<connectionStrings>
<add name="DBContext" providerName="System.Data.SqlClient" connectionString="Server=(local);Database=MVCTemplate;Integrated Security=True;" />
<add name="ElmahConnectionString" providerName="System.Data.SqlClient" connectionString="Server=(local);Database=MVCTemplate;Integrated Security=True;" />
</connectionStrings>
Replace (local)
in Server=(local);
with the name of your SQL Server instance. You can substitute MVCTemplate
in Database=MVCTemplate;
if you want to change the name of the created database.
When you build the solution the needed packages will be automatically downloaded from NUGET. If that doesn't happen, go to TOOLS > NuGet package Manager > Package Manager Settings > check Allow NuGet to download missing packages
. If that doesn't help or some of the packages cannot be downloaded, get packages.zip and extract it in the directory of the solution (this is archive of the used packages).