A dotnet CLI tool with scaffolding generators to make everyday development easier.
The CLI tool is inside the MinionSuite/MinionSuite.Tool folder. You can install it by following the instructions on how to install a dotnet CLI tool. For example, here are the instructions on how to install it as a global tool.
Navigate to the folder
cd MinionSuite/MinionSuite.Tool
Package the tool
dotnet build
dotnet pack
Install the tool
cd ..
dotnet tool install -g --add-source ./MinionSuite.Tool/nupkg MinionSuite.Tool
You can use the tool by invoking the minionsuite
command and passing a generator as a parameter. Below you can find a list of available generators.
Generates a service layer based on a model class. The service layer contains an interface and a class implementation. Please note that the ORM used is Entity Framework Core.
Usage: minionsuite servicegen [parameters]
Parameters:
-m <path>
or--model-path <path>
: The path to the model class.-ns <name>
or--namespace <name>
: The namespace of the generated classes.-o <path>
or--output <path>
: The path to the output folder (default: .).-gpm
or--generate-page-model
: Generate page model.-grm
or--generate-result-model
: Generate result model.-db <name>
or--db-context <name>
: The database context class.
Example: minionsuite servicegen -m ./Models/Post.cs -ns Example.Services -db ApplicationContext
The layer provides the following asynchronous methods:
- CreateAsync: Creates a new entity.
- DeleteAsync: Deletes an entity.
- GetAsync: Returns an entity.
- GetAllAsync: Returns a list of entities. The result is paged and sorted based on a sorting field.
- SearchAsync: Searches for entities based on a string term. The result is paged and sorted based on a sorting field.
- UpdateAsync: Updates an entity.
Generates tests for the service layer based on a model class.
Usage: minionsuite servicegen:test [parameters]
Parameters:
-m <path>
or--model-path <path>
: The path to the model class.-ns <name>
or--namespace <name>
: The namespace of the generated class.-o <path>
or--output <path>
: The path to the output folder (default: .).-db <name>
or--db-context <name>
: The database context class.
Example: minionsuite servicegen:test -m ./Models/Post.cs -ns Example.Services -db ApplicationContext
Generates a model to handle paging for queryables.
Usage: minionsuite pagemodel [parameters]
Parameters:
-ns <name>
or--namespace <name>
: The namespace of the generated classes.-o <path>
or--output <path>
: The path to the output folder (default: .).
Generates a model that represents the result of a service operation.
Usage: minionsuite resultmodel [parameters]
Parameters:
-ns <name>
or--namespace <name>
: The namespace of the generated class.-o <path>
or--output <path>
: The path to the output folder (default: .).
Generates an MVC controller with CRUD operations on a model class. It uses the service layer generated by servicegen
.
Usage: minionsuite mvccontroller [parameters]
Parameters:
-m <path>
or--model-path <path>
: The path to the model class.-ns <name>
or--namespace <name>
: The namespace of the generated class.-o <path>
or--output <path>
: The path to the output folder (default: .).
Generates integration tests for the MVC controller of a model class. The tests use the Test environment, so make sure to include an appsettings file for it and configure the database.
Usage: minionsuite mvccontroller:test [parameters]
Parameters:
-m <path>
or--model-path <path>
: The path to the model class.-ns <name>
or--namespace <name>
: The namespace of the generated class.-o <path>
or--output <path>
: The path to the output folder (default: .).-gwaf
or--generate-web-application-factory
: Generate web application factory.
Generates an API controller with CRUD operations on a model class. It uses the service layer generated by servicegen
.
Usage: minionsuite apicontroller [parameters]
Parameters:
-m <path>
or--model-path <path>
: The path to the model class.-ns <name>
or--namespace <name>
: The namespace of the generated class.-o <path>
or--output <path>
: The path to the output folder (default: .).
This project is licensed under the MIT License - see the LICENSE file for details.