Step by Step implementing Onion architecture in ASP.NET MVC Application

Source Code on the GitHub Learn Creating N-Tier Applications in C#, Part 1 by Steve Smith here - I learnt lot from this course hence sharing Recently I gave a talk on Onion Architecture in MVC application to the audience of 300 at the C-Sharpcorner conference 2015. Talk was well received and I had a … Continue reading Step by Step implementing Onion architecture in ASP.NET MVC Application

Refactoring the ASP.NET MVC Application to the Onion Architecture

We have refactored the application adhering to the onion architecture. Domain objects like Movie is at the center of the architecture and are the part of internal layers. The Infrastructure project in which we are working with database and database logics are part of the external layers. They depend on the centeral layers like core. UI or in this case the MVC application is also an external layer and depndes on the Core project. All layers are interacting to each other using the interfaces rather than the concrete definitions. You can very easily write Unit Test against the controllers using Fake or Mock without hitting the datbase. In future you can easily change data access technology from Enity Framework to something else without affecting the UI and the Core.