Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/AspNetCore-DDDPublic template

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

License

NotificationsYou must be signed in to change notification settings

ntxinh/AspNetCore-DDD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Architecture

Dependencies

Project dependencies

Code flow

Repository & Unit Of Work

Techical Stack

  • ASP.NET Core 8.0 (with .NET 8.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<user_secrets_id> atDDD.Services.Api.csproj >UserSecretsId (Free to change to any GUID/UUID)
    • Windows:C:\Users\[UserName]\AppData\Roaming\Microsoft\UserSecrets\<user_secrets_id>\secrets.json
    • Linux / macOS:~/.microsoft/usersecrets/<user_secrets_id>/secrets.json
  • secrets.json for Windows:

{"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, useMicrosoft SQL Server orAzure SQL Edge for Linux / macOS

  • secrets.json for Linux / macOS:

{"ConnectionStrings": {"DefaultConnection":"Data Source=<ip_address>,1433;Initial Catalog=aspnetcore-ddd;User ID=SA;pwd=<YourNewStrong@Passw0rd>;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:
dotnet build Src/DDD.Services.Api/DDD.Services.Api.csprojdotnet run --project Src/DDD.Services.Api/DDD.Services.Api.csproj --launch-profile Devdotnet watch --project Src/DDD.Services.Api/DDD.Services.Api.csproj run

Testing

  • Terminal:dotnet test

Docker

docker build -t aspnetcore-docker-image.docker run -it --rm -p 3000:80 --name aspnetcore-docker-container aspnetcore-docker-imagedocker run -d -p 3000:80 --name aspnetcore-docker-container aspnetcore-docker-image
docker compose up -ddocker compose psdocker compose stop

Podman

podman build -t aspnetcore-docker-image.podman run -it --rm -p 3000:80 --name aspnetcore-docker-container aspnetcore-docker-imagepodman run -d -p 3000:80 --name aspnetcore-docker-container aspnetcore-docker-image
podman-compose up -dpodman-compose pspodman-compose stop

Swagger (Dev env only)

Health check (Staging & Prod env only)

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
  • Useabstract keyword to appropriate class
  • UseIQueryable,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 (Usedefault 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


[8]ページ先頭

©2009-2025 Movatter.jp