Templates for creating .NET Core items and projects. Many are based on various principles and patterns in Domain Driven Design (DDD), including Event Sourcing (ES), Command/Query Responsibility Segregation (CQRS), Repository patterns, and more.
https://docs.microsoft.com/en-us/dotnet/core/tools/custom-templates
https://devblogs.microsoft.com/dotnet/how-to-create-your-own-templates-for-dotnet-new/
- Add a
.template.config
folder at the root of the project or code you want templated. - Add a
template.json
file in this folder. - Copy and modify the following code as needed
{ "$schema": "http://json.schemastore.org/template", "author": "Me", "classifications": [ "Common", "Console", "C#8" ], "identity": "ExampleTemplate.AsyncProject", "name": "Example templates: async project", "shortName": "consoleasync", "tags": { "language": "C#", "type": "project" } }
- Install it by navigating to this folder and execute
dotnet new -i .\
- Uninstall it by first finding it with
dotnet new -u
- Then copy the path and run it with
dotnet new -u "path"