A Microservice System template repository based on Clean Architecture and ASP.NET Core Blazor Web Assembly.
- Select
CleanMicroserviceSystem.Tethys.WebAPI
or your specified project as Startup project; - Open
Package Manager Console
in Visual Studio; - Select
CleanMicroserviceSystem.Tethys.Infrastructure
as Default project in Package Manager Console; - Input below commands and execute;
Command | Description |
---|---|
Get-Help entityframework | Displays information about entity framework commands. |
Add-Migration | Creates a migration by adding a migration snapshot. |
Remove-Migration | Removes the last migration snapshot. |
Update-Database | Updates the database schema based on the last migration snapshot. |
Script-Migration | Generates a SQL script using all the migration snapshots. |
Scaffold-DbContext | Generates a DbContext and entity type classes for a specified database. This is called reverse engineering. |
Get-DbContext | Gets information about a DbContext type. |
Drop-Database | Drops the database. |
For examples:
## To generate database migration code files automatically
Add-Migration AddGenericOption_WebAPILog
## To execute database migration code files and apply modifications to current connected database file
Update-Database
This layer is a web application. This layer depends on both the Application and Infrastructure layers, however, the dependency on Infrastructure is only to support dependency injection. Therefore only Startup.cs should reference Infrastructure.
This layer contains classes for accessing external resources such as file systems, web services, smtp, and so on. These classes should be based on interfaces defined within the application layer.
This layer contains all application logic. It is dependent on the domain layer, but has no dependencies on any other layer or project. This layer defines interfaces that are implemented by outside layers. For example, if the application need to access a notification service, a new interface would be added to application and an implementation would be created within infrastructure.
This will contain all entities, enums, exceptions, interfaces, types and logic specific to the domain layer.
- Web UI/API
- Infrastructure
- Common
- Extension
- Identity
- Persistence
- DBContext
- Migrations
- Services
- ConfigureServices.cs
- Applications
- Common
- Behavious
- IPipelineBehavior implementations of MediatR
- Exceptions
- Mappings
- Models (DTO)
- Attribute
- Behavious
- Configurations
- Interfaces
- Repositories
- Extensions
- Exceptions
- Features
- {BusinessDomainEntity}
- Commands
- [Create/Update/Delete/Import]{Entity}
- Command.cs
- Inject Reader
- Inject Writer
- CommandValidator.cs
- Command.cs
- [Create/Update/Delete/Import]{Entity}
- Queries
- Get{Entity}WithPagination
- Query.cs
- Inject Reader
- QueryValidator.cs
- Query.cs
- Get{Entity}WithPagination
- EventHandlers
- Commands
- {BusinessDomainEntity}
- ConfigureServices.cs
- Common
- Domain
- Common
- BaseAuditableEntity.cs
- BaseEntity.cs
- BaseEvent.cs
- ValueObject.cs
- Entities
- Enums
- Events
- Exceptions
- ValueObjects
- Common
- Tethys - TemplateService
- Oceanus - CommonLibrary
- 俄刻阿诺斯,Tethys 的丈夫。十二提坦神,水神大洋神,他是那条环绕着宇宙转动的河流腰带,故而他的结尾也是开端:这条宇宙之河自我组成一个圆圈在转动。
- Uranus - Gateway
- Prometheus - LogService
- Themis - IdentityServer
- 忒弥斯(Θεμις / Themis,“法律”)是法律和正义的象征。忒弥斯是宙斯最尊重最信任的妻子。是秩序的创造者、守护者。
- Aphrodite - WebUI
- Astra - NuGet
- 阿斯特拉,星辰之神,阿斯特赖俄斯与厄俄斯诸子,数量不定。