Skip to content

TheLe0/create-dotnet-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clean Architecture .NET Solution Scaffolder

This PowerShell script streamlines the creation of a complete .NET solution structured according to Clean Architecture principles.

Features:

  • Multi-language support (C# and F#)
  • Compatibility with multiple .NET versions
  • Support for various presentation projects (API, MVC, Console, and Service Worker)

Usage

To create a new .NET solution using the Clean Architecture scaffolder, use the create-dotnet-app command in your terminal. Below are the arguments you can use with this command:

Command Syntax

create-dotnet-app [-solutionName <name>] [-dotnetVersion <version>] [-language <lang>] [-presentationType <type>]

Arguments

  • -solutionName (Required): Specifies the name of the solution to be created. This is the only required argument.
  • -dotnetVersion (Optional): Specifies the .NET version to use for the solution. Default is "net8.0". Supported values: "net6.0", "net7.0", "net8.0"
  • -language (Optional): Specifies the programming language for the solution. Default is "C#". Supported values: "C#", "F#"
  • -presentationType (Optional): Specifies the type of presentation project to create. Default is "api". Supported values: "api", "mvc", "console", "serviceworker"

Setup

To set up in your CLI, first clone this repository to a location on your operating system. Then, run the commands above to configure the alias.

Note: the /path/to/your/script/ is where the repository was cloned on your OS.

MacOs

  1. You can open this file in a text editor. If the file doesn't exist, you can create it.
nano ~/.zshrc
  1. Add the following line to the file:
alias create-dotnet-app='pwsh /path/to/your/script/create-dotnet-app.ps1'
  1. After saving the file, apply the changes by running:
source ~/.zshrc

Linux

nano ~/.bashrc
  1. Add the following line to the file:
alias create-dotnet-app='pwsh /path/to/your/script/create-dotnet-app.ps1'
  1. After saving the file, apply the changes by running:
source ~/.bashrc

Windows

notepad $PROFILE
  1. Add the following function to the profile script:
function create-dotnet-app {
    param (
        [string]$solutionName,
        [string]$dotnetVersion = "net8.0",
        [string]$language = "C#",
        [string]$presentationType = "api"
    )
    & 'C:\Path\To\Your\Script\create-dotnet-app.ps1' -solutionName $solutionName -dotnetVersion $dotnetVersion -language $language -presentationType $presentationType
}
  1. After saving the file, apply the changes by running:
. $PROFILE

About

Powershell script to scaffold .NET applications

Resources

License

Stars

Watchers

Forks

Packages

No packages published