Skip to content

.NET Core 8.0 - CRUD - Web API Clean Architecture using Repository Pattern and Dapper.

Notifications You must be signed in to change notification settings

Khan-Ataur/CRUD_WebAPI_CleanArch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 

Repository files navigation

.NET Core 8.0 - CRUD - Web API Clean Architecture using Repository Pattern and Dapper.

I have used following tools, technologies, and framework in this project:

  • Visual Studio 2022 and .NET Core 8.0
  • C#
  • MS SQL DB
  • Clean Architecture :
  • The Clean Architecture is the system architecture guideline proposed by Robert C. Martin also known as Uncle Bob. It derived from many architectural guidelines such as Hexagonal Architecture, Onion Architecture, etc.
  • Dapper (mini ORM)
  • Dapper is a simple Object Mapper or a Micro-ORM and is responsible for mapping between database and programming language.
  • Repository Pattern
  • Unit of Work
  • Swagger UI
  • API Authentication (Key Based)
  • Solution and Project setup:

    ******According to Clean Architecture*******

    a) Core Layer: Core Layer is independent i.e core layer does not depend on any other layer.

    b) Appliction Layer: Application layer depends on Core layer. To do this, add referance of core layer into Application layer.

                    - Add folder named Interfaces

    c) Logging Layer: Logging layer depends on Application layer. To do this, add referance of Application layer into Logging layer.

                    And add log4net nuget package in this layer.

    d) Infrastructure Layer: Infrastructure layer depends on both Application and Core layer. To do this, add referance of both layer into infrastructure layer.

                     - Add folder named Repository 

                      - Add folder named Dapper

                      - Install nuget package : Dapper

                      - Install nuget package : Microsoft.Extensions.Configuration

                      - Install nuget package : Microsoft.Extensions.DependencyInjection.Abstractions

                      - Install nuget package : System.Data.SqlClient

    e) Presentation Layer: In this layer I have used ASP.NET Core Web API project. Presentation layer depends on all layer. To do this, add referance of Application,Core, Infrustructure and Logging layer  into this layer.

     

    About

    .NET Core 8.0 - CRUD - Web API Clean Architecture using Repository Pattern and Dapper.

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published