Kros.Templates.CqrsProject
is a template to create a project according to the CQRS pattern.
Create ASP.NET Core WebApi application with our recommended directory structure, packages, configuration.
It also creates basic commands, queries, a repository for entity that you can name using the --entityName
and --entityNamePlural
switches. More info about the project structure and CQRS can be read in demo example.
- Instal
Kros.Templates.CqrsProject
dotnet template fromnuget.org
.dotnet new -i Kros.Templates.CqrsProject
- Create directory and create your CQRS project.
dotnet new kros-cqrs --entityName Person --entityNamePlural People
dotnet-cli by this template create runnable project. - Change connection string in
appsettings.local.json
to yourSQL Server
.
"ConnectionStrings": {
"DefaultConnection": "Server={serverName};Initial Catalog={databaseName};Integrated Security=True;KormAutoMigrate=true;"
}
- Add settings to
appsettings.local.json
for yourIdentity Server
.
"IdentityServerHandlers": [
{
"AuthenticationScheme": "",
"ApiName": "",
"AuthorityUrl": "",
"Proxy": {
"Address": ""
},
"RequireHttpsMetadata": true
}
]
- Run and enjoy.
-e
--entityName
- Main entity name. Template create commands, query, entity, repository, controller, ... for this entity.-en
--entityNamePlural
- Plural for entity name.