MVC5-Scaffolder, scaffolder.

Source: Internet
Author: User

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.

  • UI (Presentation) Layer
    • ASP. net mvc-(Sample app: Northwind. Web)
    • Kendo UI-(Sample app: Northwind. Web)
    • AngularJS-(Sample app: Northwind. Web)
  • Service and Data Layer
    • Repository Pattern-Framework (Repository. Pattern, Repository. Pattern. Ef6, Northwind. Repository)
    • Unit of Work Pattern-Framework (Repository. Pattern, Repository. Pattern. EF6, Northwind. Repository)
    • Entity Framework
    • Service Pattern-Framework (Service. Pattern, Northwind. Service)
  • Domain Driven Design (* slated for release v4.0.0)

    • Domain Events
    • * More to come
  • The general style of running is as follows using Boostrap sb-admin.css

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.