SaigonMio.Generata 1.1.36

dotnet tool install --global SaigonMio.Generata --version 1.1.36
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local SaigonMio.Generata --version 1.1.36
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=SaigonMio.Generata&version=1.1.36
                    
nuke :add-package SaigonMio.Generata --version 1.1.36
                    

Mio.Generata

A CLI tool to generate project structure including Areas, Controllers, Views, Models, ViewModels, Interfaces, Services, and basic CRUD operations 🐼.

Mio.Generata simplifies the process of scaffolding an ASP.NET Core MVC project by automating the creation of essential components with customizable options like AJAX-based CRUD and compatibility with older codebases. Built with love by Mr.Banh, it even comes with cute worm (πŸ›) and cat (🐈) animations to make your coding experience more enjoyable!


Features

  • Full Project Structure: Generates Areas, Controllers, Views, Models, ViewModels, Interfaces, and Services.
  • CRUD Operations: Automatically includes basic Create, Read, Update, Delete functionality.
  • Single or Multiple Models: Supports generating structures for one or multiple models at once.
  • AJAX Support: Optional modal-based create/update with AJAX.
  • Backward Compatibility: Works with older projects missing MioBaseController.
  • Fun Animations: Watch worms and cats dance across your terminal as files are created!

Installation

Install Mio.Generata as a global .NET tool using the following command: dotnet tool install -g Mio.Generata

To update to the latest version: dotnet tool update -g Mio.Generata

Usage

Command Syntax

Single Model

generata gen <area-name> <model-name> [<root-path>] [options]

Multiple Models

generata gen <area-name> <model-name1>:<model-name2>:<model-name3> [<root-path>] [options]

Arguments

  • <area-name>: The name of the Area (e.g., Blog). Required.
  • <model-name>: The name of the Model (e.g., Blog). For multiple models, separate with : (e.g., Blog:Post:Comment). Required.
  • <root-path>: The root directory of your project containing the .csproj file. Optional if you're already in the project directory.

Options

  • -a, --ajax: Enables AJAX-based create/update modals (default: false).
  • -e, --enable-old: Enables compatibility with older projects lacking MioBaseController (default: false).
  • --check: Checks for and installs the latest version of Mio.Generata.

Examples

Generate MVC CRUD

This creates a Blog area with a Blog model, including all necessary files for standard MVC CRUD. generata gen Blog Blog D:\0_Project\MioCenter_BE\MioCenter.CompanySite

Generate AJAX CRUD

Same as above, but with AJAX-enabled create/update modals. generata gen Blog Blog D:\0_Project\MioCenter_BE\MioCenter.CompanySite --ajax

Generate Multiple Models

Generates structures for Product, Category, and Order models within the Shop area.

Run in Current Directory

If you're already in the project folder: generata gen Blog Blog

Output

The tool creates a structured project with folders and files like this: MioCenter.CompanySite/ β”œβ”€β”€ Areas/ β”‚ β”œβ”€β”€ Blog/ β”‚ β”‚ β”œβ”€β”€ Controllers/ β”‚ β”‚ β”‚ └── BlogController.cs β”‚ β”‚ β”œβ”€β”€ Views/ β”‚ β”‚ β”‚ └── Blog/ β”‚ β”‚ β”‚ β”œβ”€β”€ Index.cshtml β”‚ β”‚ β”‚ └── BlogForm.cshtml (if not using --ajax) β”‚ β”‚ β”œβ”€β”€ _ViewImports.cshtml β”‚ β”‚ └── _ViewStart.cshtml β”œβ”€β”€ MioCenter.Core/ β”‚ β”œβ”€β”€ Models/ β”‚ β”‚ └── Blogs/ β”‚ β”‚ └── Blog.cs β”‚ β”œβ”€β”€ ViewModel/ β”‚ β”‚ └── Blogs/ β”‚ β”‚ └── BlogViewModel.cs β”œβ”€β”€ MioCenter.Services/ β”‚ β”œβ”€β”€ Interfaces/ β”‚ β”‚ └── Blogs/ β”‚ β”‚ └── IBlogService.cs β”‚ β”œβ”€β”€ Services/ β”‚ β”‚ └── Blogs/ β”‚ β”‚ └── BlogService.cs


Notes

  • Migration: If you generate a new model, don’t forget to run dotnet ef migrations add <MigrationName> in your project.
  • Rollback: If something goes wrong, the tool will attempt to delete created files. You can also use git reset --hard to discard changes.
  • Requirements: Ensure your project is an ASP.NET Core MVC project and you're running .NET 6.0 or later.

Troubleshooting

  • "Could not find CompanySite or AdminSite": Check your <root-path> or ensure you're in the correct directory.
  • File already exists: The tool skips existing files and notifies you with a πŸ“„ symbol.
  • Errors during generation: Check the console output for details and clean up with Git if needed.

Author

Mr.Banh (Cake) πŸ›
A developer who loves automation, cats (🐈).


Happy coding!😺

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.1.36 1,095 3/24/2025
1.1.35 177 2/12/2025