Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

AspNetCore-DDD

> DevOps
Open source

Full ASP.NET Core 10.0 LTS application with DDD, CQRS and Event Sourcing

883 stars0 likes3 views
WebsiteGitHub

About

Full ASP.NET Core 10.0 LTS application with DDD, CQRS and Event Sourcing

Diagram

Overview

Architecture

Dependencies

Project dependencies

Code flow

Repository & Unit Of Work

Techical Stack

  • ASP.NET Core 10.0 (with .NET 10.0)
  • ASP.NET WebApi Core
  • ASP.NET Identity Core
  • Entity Framework Core
  • .NET Core Native DI
  • AutoMapper
  • FluentValidation
  • MediatR
  • Swagger UI
  • MSSQL
  • xUnit
  • Moq
  • FluentAssertions
  • Polly
  • Refit
  • DbUp
  • NPOI
  • Quartz
  • StyleCop

Design Patterns

  • Domain Driven Design
  • Domain Events
  • Domain Notification
  • CQRS
  • Event Sourcing
  • Unit Of Work
  • Repository & Generic Repository
  • Inversion of Control / Dependency injection
  • ORM
  • Mediator
  • Specification Pattern
  • Options Pattern

Pre-Configuration

  • Config User Secret:

    • Find `` at DDD.Services.Api.csproj > UserSecretsId (Free to change to any GUID/UUID)
    • Windows: C:\Users\[UserName]\AppData\Roaming\Microsoft\UserSecrets\\secrets.json
    • Linux / macOS: ~/.microsoft/usersecrets//secrets.json
  • secrets.json for Windows:

json
{
  "ConnectionStrings": {
    "DefaultConnection": "Server=(localdb)\\MSSQLLocalDB;Database=DDD;Trusted_Connection=True;MultipleActiveResultSets=true"
  }
}
  • LocalDB is a packaging mechanism for SQL Server Express Edition, and is only available for Windows, use Microsoft SQL Server or Azure SQL Edge for Linux / macOS

  • secrets.json for Linux / macOS:

json
{
  "ConnectionStrings": {
    "DefaultConnection": "Data Source=,1433;Initial Catalog=aspnetcore-ddd;User ID=SA;pwd=;Integrated Security=False;ConnectRetryCount=0;MultipleActiveResultSets=True"
  }
}

How to run

  • For Visual Studio: Select profile > Run (F5)
  • For VSCode: Select configuration > Run (F5)
  • For Terminal:
bash
dotnet build Src/DDD.Services.Api/DDD.Services.Api.csproj
dotnet run --project Src/DDD.Services.Api/DDD.Services.Api.csproj --launch-profile Dev
dotnet watch --project Src/DDD.Services.Api/DDD.Services.Api.csproj run

Testing

  • Terminal: dotnet test

Docker

bash
docker build -t aspnetcore-docker-image .
docker run -it --rm -p 3000:80 --name aspnetcore-docker-container aspnetcore-docker-image
docker run -d -p 3000:80 --name aspnetcore-docker-container aspnetcore-docker-image
  • http://localhost:3000/
bash
docker compose up -d
docker compose ps
docker compose stop
  • http://localhost:80/

Podman

bash
podman build -t aspnetcore-docker-image .
podman run -it --rm -p 3000:80 --name aspnetcore-docker-container aspnetcore-docker-image
podman run -d -p 3000:80 --name aspnetcore-docker-container aspnetcore-docker-image
  • http://localhost:3000/
bash
podman-compose up -d
podman-compose ps
podman-compose stop
  • http://localhost:80/

Swagger (Dev env only)

  • http://localhost:5000/swagger

Health check (Staging & Prod env only)

  • http://localhost:5000/hc-ui
  • http://localhost:5000/hc-json

TODO

  • Use multiple environments
  • Transaction (Unit of Work)
  • Validation (FluentValidation)
  • Response wrapper
  • Async/Await
  • REST
  • JWT
  • Mapping (AutoMapper)
  • API Specification, API Definition (Swagger)
  • ORM {Entity Framework Core}
  • Middleware
  • CORS
  • Pagination
  • Sorting
  • Error Handling, Global Exception
  • HealthCheck
  • Mail
  • Http
  • Database Auditing: CreatedAt/UpdatedAt CreatedBy/UpdatedBy
  • Soft Delete
  • Common: Constants, Helpers
  • Docker, Docker Compose, Github Container Registry
  • EF: Shadow Properties
  • Events
  • Unit Testing
  • Integration Testing
  • Scoped over Transient
  • Use abstract keyword to appropriate class
  • Use IQueryable, IEnumerable, IList interfaces
  • Use NetStandard 2.1 for Class Library
  • Hashing
  • AnalysisLevel: Automatically find latent bugs (It was enabled by default for .NET 5 or above)
  • Migration (DbUp)
  • User Secrets
  • API Versioning
  • API Versioning with Swagger
  • Kubernetes
  • AKS
  • Hot reload
  • SignalR
  • Notifications
  • Webhook
  • Task scheduling & Queues: Quartz
  • Quartz: Fire-and-forget
  • NPOI
  • REST Client
  • StyleCopAnalyzers (Use default rules set and disable 9 rules: SA0001, SA1200, SA1201, SA1309, SA1400, SA1512, SA1600, SA1601, SA1633)
  • RoslynAnalyzers (It was enabled by default for .NET 5 or above)
  • Secret Manager
  • OmniSharp Roslyn
  • sonar-dotnet
  • docfx
  • Autofac
  • Bogus
  • Scaffold
  • Data Seeding
  • Logging
  • OAuth2, OIDC (OpenId Connect)
  • Search
  • Kafka, RabbitMQ
  • Microservices, API Gateway (Ocelot, yarp)
  • Multi-tenancy
  • Primary Key to Integer
  • File storage: Upload/Download
  • Globalization & Localization
  • Caching
  • Kestrel
  • Session & Cookie
  • Encryption
  • EF: No-tracking queries
  • Dapper, Dapper Contrib (Optional)
  • RepoDB
  • BulkInsert, BulkUpdate, Async method for IRepository

References

  • https://github.com/EduardoPires/EquinoxProject
  • https://docs.microsoft.com/en-us/aspnet/core/security/authorization/roles
  • https://docs.microsoft.com/en-us/aspnet/core/security/authorization/claims
  • https://docs.microsoft.com/en-us/aspnet/core/security/authorization/policies
  • https://docs.microsoft.com/en-us/aspnet/core/security/authorization/limitingidentitybyscheme
  • https://www.red-gate.com/simple-talk/dotnet/c-programming/policy-based-authorization-in-asp-net-core-a-deep-dive/
  • https://docs.microsoft.com/en-us/archive/msdn-magazine/2017/october/cutting-edge-policy-based-authorization-in-asp-net-core
  • https://dev.azure.com/Techhowdy/_git/NG_Core_AuthRTDB
  • https://github.com/Elfocrash/Youtube.AspNetCoreTutorial
  • https://www.meziantou.net/entity-framework-core-soft-delete-using-query-filters.htm
  • https://docs.microsoft.com/en-us/aspnet/core/fundamentals/environments
  • https://michael-mckenna.com/multi-tenant-asp-dot-net-core-application-tenant-resolution
  • https://stackify.com/writing-multitenant-asp-net-core-applications/
  • https://github.com/DanielRBowen/SimpleMultiTenant
  • https://deviq.com/specification-pattern/
  • https://devblogs.microsoft.com/dotnet/automatically-find-latent-bugs-in-your-code-with-net-5/
  • https://xunit.github.io/docs/why-no-netstandard

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C#aspnetcoreautomappercqrscsharp

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理