Here I am going to explain how to implement dependency injection in MVC Project in detail including separate layers for getting data through Services and Repositories. Steps Step 1: open visual studio, goto File->New->Project Step 2: Select “Web” from left menu, “ASP.NET Web Application (.NET Framework)” from Project types list and give some name to application (I am giving it as DI). Step 3: Select “Empty” template, check MVC Checkbox below and click “OK” It will take little time to create the solution. Step 4: Open Solution Explorer, it will create the folder structure as shown below. Step 5: Now we are going to create DAL (Data Access Layer), where data is available, Right Click on Solution Explorer, Goto Add->New Project… Step 6: Select “Windows” from left menu, “Class Library” from Project list, give some name (DAL), click on OK. Step 7: “Class1.cs” will be opened . Right click on Class1.cs in solution explorer, click “Re...
All about Microsoft .net technology