GithubHelp home page GithubHelp logo

iammukeshm / onionarchitecture Goto Github PK

View Code? Open in Web Editor NEW
452.0 14.0 115.0 31 KB

The onion architecture, introduced by Jeffrey Palermo, overcomes the issues of the layered architecture with great ease. With Onion Architecture, the game-changer is that the Domain Layer (Entities and Validation Rules that are common to the business case ) is at the Core of the Entire Application. This means higher flexibility and lesser coupling. In this approach, we can see that all the Layers are dependent only on the Core Layers.

Home Page: https://www.codewithmukesh.com/blog/onion-architecture-in-aspnet-core/

C# 100.00%
onion-architecture asp-net-core cqrs-pattern webapi clean-architecture

onionarchitecture's Introduction

Onion Architecture In ASP.NET Core With CQRS

The onion architecture, introduced by Jeffrey Palermo, overcomes the issues of the layered architecture with great ease. With Onion Architecture, the game changer is that the Domain Layer (Entities and Validation Rules that are common to the business case ) is at the Core of the Entire Application. This means higher flexbility and lesser coupling. In this approach, we can see that all the Layers are dependent only on the Core Layers.

Give a Star ⭐️

If you found this Implementation helpful or used it in your Projects, do give it a star. Thanks!

Overview

alt text

We will talk about Onion Architecture In ASP.NET Core and it's advantages. We will also together build a WebApi that follows a variant of Onion Architecture so that we get to see why it is important to implement such an architecture in your upcoming projects.

Here is a list of features and tech we will be using for this setup.

  • Onion Architecture
  • Entity Framework Core
  • .NET Core 3.1 Library / .NET Standard 2.1 Library / ASP.NET Core 3.1 WebApi
  • Swagger
  • CQRS / Mediator Pattern using MediatR Library
  • CRUD Operations
  • Inverted Dependencies
  • API Versioning
Read more on my Blog Post - https://www.codewithmukesh.com/blog/onion-architecture-in-aspnet-core/

Full Fledged Clean Architecture Solution for ASP.NET Core WebApi

I am building a more complex variant of this implementation that will be production ready. Check out the Repository @ https://github.com/iammukeshm/CleanArchitecture.WebApi

Questions? Bugs? Suggestions for Improvement?

Having any issues or troubles getting started? Get in touch with me

Support

Has this Project helped you learn something New? or Helped you at work? Do Consider Supporting.

Buy Me A Coffee

Share it!

I have personally not come across a clean implementation on a WebAPI, which is the reason that I started building this up. There are quite a lot of improvements and fixes along the way from the day I started out. Thanks to the community for the support and suggestions. Please share this Repository within your developer community, if you think that this would a difference! Thanks.

About the Author

Mukesh Murugan

onionarchitecture's People

Contributors

anthonypwatts avatar iammukeshm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onionarchitecture's Issues

MediatR is now superseeded

If you upgrade to latest version, the syntax for AddMediatR has changed:

        services.AddMediatR(cfg => 
                {
                cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
                }
        );

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.