Getting Started
You can create a project from the templates with the .NET CLI or from Visual Studio.
Create a project with the CLI
Install the latest .NET SDK and Visual Studio 2022.
Install the templates:
dotnet new install Milvasoft.TemplatesSee the options of the project template:
dotnet new milvonion --helpCreate the solution:
dotnet new milvonion -n MyAppThen follow the
README.mdof the generated solution (requirements, first migration, tests). The same steps are described in Milvonion Template.To add a CRUD feature, run this in the solution root:
dotnet new mediatr-crud -n Product --projectName MyApp --pluralName Products
Create a project with Visual Studio
- Install the latest .NET SDK and Visual Studio 2022.
- Install the templates:
dotnet new install Milvasoft.Templates - Close all Visual Studio instances.
- Open Visual Studio and click Create New Project. Search for "Milva", select the template and click Next.
- From here the steps are the same as with the CLI.
Template options
dotnet new milvonion accepts these options:
| Option | Description | Default |
|---|---|---|
Framework | Target framework. Only net11.0 is supported. | net11.0 |
RoutePrefix | The API route prefix. | api |
HttpPort | The application's HTTP port. | 5000 |
HttpsPort | The application's HTTPS port. | 5001 |
PostgreConnectionString | Your PostgreSQL connection string with the database name. It is written only into appsettings.Development.json. | a placeholder |
Nullable | Nullable annotations and warnings context: enable, disable, warnings or annotations. | disable |
Every generated project gets its own user secrets ID, so two projects never share a user secrets store.
Uninstall
dotnet new uninstall Milvasoft.Templates