CleanArchitecture.ASP.NETCore.WebAPI 1.0.292

Suggested Alternatives

Hack3rlife.ASP.NETCore.WebAPI

Additional Details

Same package but with an updated name to follow ID prefix reservation criteria

dotnet new install CleanArchitecture.ASP.NETCore.WebAPI::1.0.292
This package contains a .NET Template Package you can call from the shell/command line.

Clean Architecture Template

The following solution template can be used for creating C# ASP .NET Core WebAPI using Clean Architecture Design Pattern Principles.

Frameworks, tools and techologies used

  1. ASP .NET Core 3.1
  2. MediatR
  3. FluentValidation
  4. FluentAssertions
  5. Moq
  6. Docker
  7. Lorem.Universal.NET
  8. Newtonsoft.Json
  9. xUnit
  10. Swashbuckle.AspNetCore

Index

Getting Started

  1. Install Visual Studio
  2. Install the latest .NET 5 SDK | .NET 6 SDK
  3. Install .Net Core 3.1 SDK.

Local Installation

  1. Clone this repository in your computer in a local <DIRECTORY> (e.g.: C:\Users\hack3rlife\source\repos).
  2. Install the template by running the following command: dotnet new <DIRECTORY>.
  3. Create a new directory (e.g.: hack3rlife-cleanarchitecture) and cd into it.
  4. Create a new solution by executing the following command dotnet new -i CleanArchitectureNetCoreWebAPI -n <PROJECT_NAME>.

NuGet Installation

  1. Execute dotnet new -i CleanArchitecture.ASP.NETCore.WebAPI to install the latest version.
    1. Execute dotnet new -u CleanArchitecture.ASP.NETCore.WebAPI to uninstall the template.

How the code is organized

The solution is organized in the following way

- BlogWebApi.WebApi.sln

    | - README.md

    | - src

        | - BlogWebApi.Application

        | - BlogWebApi.Domain

        | - BlogWebApi.Infrastructure

        |- BlogWebApi.WebApi

    | - tests

        | - Application.UnitTest

        | - Infrastructure.IntegrationTests

        | - WebApi.EndToEndTests

Domain Project

This project will include Domain Models, Interfaces that will be implemented by the outside layers, enums, etc., specific to the domain logic. This project should not have any dependecy to another project since it is the core of the project.

Domain Types

  • Domain Models
  • Interfaces
  • Exceptions
  • Enums

Application Project

This project will contain the application logic. The only dependency that should have is the Domain project. Any other project dependency must be removed.

Appllication Types

  • Exceptions
  • Interfaces
  • DTOs
  • Mappers

Infrastructure Project

The Infrastructure project generally includes data access implementations or accessing external resources as file sytems, SMTP, third-party services, etc. These classes should implementations of the Interfaces defined in the Domain Project. Therefore, the only dependency in this project should be to the Domain Project. Any other dependency must be removed.

Infrastructure Types

  • EF Core Types
  • Repository Implementation

WebAPI Project

This is the entry point of our application and it depends on the Application and Infrastrucre projects. The dependency on Infrastructre Project is requiered to support Dependency Injection in the Startup.cs class. Therefore, no direct instantiation of or static calls to the Infrastucture project should be allowed.

WebAPI Types

  • Controllers
  • Startup
  • Program

References

  • .NETCoreApp 3.1

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.292 1,749 1/12/2022
1.0.290 1,530 1/11/2022
1.0.288 1,457 1/11/2022
1.0.287 1,448 1/11/2022
1.0.214 1,319 12/15/2021
1.0.203 1,364 12/10/2021
1.0.193 1,363 11/18/2021
1.0.191 1,284 11/18/2021
1.0.2 1,532 10/29/2021
1.0.1 1,361 10/29/2021
1.0.0 1,345 10/29/2021