Skip to content

Latest commit

 

History

History
43 lines (35 loc) · 1.58 KB

File metadata and controls

43 lines (35 loc) · 1.58 KB

CQRS template

About

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.

Quick start

  1. Instal Kros.Templates.CqrsProject dotnet template from nuget.org. dotnet new -i Kros.Templates.CqrsProject
  2. Create directory and create your CQRS project. dotnet new kros-cqrs --entityName Person --entityNamePlural People dotnet-cli by this template create runnable project.
  3. Change connection string in appsettings.local.json to your SQL Server.
 "ConnectionStrings": {
    "DefaultConnection": "Server={serverName};Initial Catalog={databaseName};Integrated Security=True;KormAutoMigrate=true;"
 }
  1. Add settings to appsettings.local.json for your Identity Server.
 "IdentityServerHandlers": [
     {
         "AuthenticationScheme": "",
         "ApiName": "",
         "AuthorityUrl": "",
         "Proxy": {
             "Address": ""
         },
         "RequireHttpsMetadata": true
     }
 ]
  1. Run and enjoy.

Template options

  • -e --entityName - Main entity name. Template create commands, query, entity, repository, controller, ... for this entity.
  • -en --entityNamePlural - Plural for entity name.