MVC5-Scaffolder, scaffolder.
[Switch] Visual Studio.net 2013 asp.net MVC 5 Scaffolding code generation wizard open-source project
The best way to improve development efficiency and standardize code writing is to use a simple design mode (MVC, Repoistory Pattern) + template generation tool. Every small software company seems to have its own basic development platform, most of which dynamically generate CRUD operation Pages Based on Data Dictionary + template; generally, project 80% code can be generated through templates, but it does not mean that project development time can be shortened by 80%, after all, it takes a lot of time to understand and develop a lot of business operations based on user needs. However, with the accumulation and accumulation of project experience, it can help future projects.
With the prevalence of mobile Internet, mobile apps, IPAD, and other mobile devices, it seems that all requirements require mobile applications. I think this is why MVC has become increasingly popular recently. Not only is MVC concise (relative to web Form), but also MVC is indeed more suitable for browsing on different devices than Web Form, and is easier to encapsulate and reuse (Partial View, layoutTemplate ).
Recently, a MVC-based code generation tool has been developed, but it is also being modified by others. If you are interested, you can participate in the improvement together, github is a good thing, that is, the access speed in China is too slow.
My project address https://github.com/neozhu/MVC5-Scaffolder
Project Phase
- Currently, the addition, deletion, modification, and query of a single object are basically implemented.
- The next step is to dynamically create navigation menu configurations
- All pages are real Ajax partial refreshes
- Top navigation bar notification function
- Add login registration page template
- One-to-multiple add and edit templates
MVC5-Scaffolder open source project
The function of this tool automatically generates the EntityFramework + UnitOfWork Repository Framework project code through the template. For the overall project architecture, see Generic Unit of Work and Repositories (lightweight fluent) Framework with Sample Northwind ASP. net mvc 5 Application, as shown in, is a perfect architecture.
MVC5-Scaffolder project structure and composition
Demo
--- UnitOfWorkFramework-source code downloaded from the Internet (http://genericunitofworkandrepositories.codeplex.com /)
-- WebApp-Web project
MVC5Scaffloding -Vs.net 2013 code generation wizard plug-in Project
--- Templates generated by all codes include View, Controller, Repoistory, Service, and dependent external classes.
MVC5Scaffloding. vsix-installation project
Code Template
MvcControllerWithContext-Controller Code Template
_ Layout-homepage Template
_ SideNavBar-main menu navigation bar
_ TopNavBa-top navigation bar on the home page
Sb-admin -- css style the simplest style downloaded on the Internet
MvcView -- CRUD Template
Repoistories-the generated extension method can be understood as the data access layer
Services-generate business logic layer code
Object Class Structure
The original Metadata data class is also required to generate verification rules through the wizard.
It can also be easily modified
Repoistories, service code structure
The template generates object methods associated with the object, such as getting the object set associated with the object through the foreign key.
The Service layer also generates all related methods and entities.
The Service layer is on the Repoistory layer. If the business logic is complex and requires multiple Repository implementations, a service will contain multiple Repository
Controller code structure
In addition to the basic addition, deletion, modification, and query, the Index method implements paging queries, and sorting has not yet been implemented.
IProductService, IUnitOfWorkAsync is created through Unity dependency Injection
Configure Unity Registration Information
First, the project needs to install Unity boostrapper for asp.net mvc through nuget.
Register the created Repoistory and Service Classes
Run debugging
This is the basic style generation.
The Index homepage provides paging and query functions.
Modification can be deleted
At present, it is just a prototype, and many other functions need to be improved. If you are interested, you can join us for help.