Git Product home page Git Product logo

neozhu / mvc5-scaffolder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from robinli/mvc5-scaffolder

176.0 40.0 122.0 169.26 MB

ASP.NET MVC 5 SmartCode Scaffolding is an ASP.NET MVC Web application code generation framework integration in Visual Studio.Net development tools, use SmartCode Scaffolding can quickly complete a set of View, Controller and Model, the Service standard code.Reduces programmers from writing repetitive code during system development, and helps team members to follow the same architecture and specifications.Reduce the time of debugging and improve the development efficiency of software projects.。

Home Page: http://neozhu.github.io/MVC5-Scaffolder/#/

Batchfile 0.01% CSS 13.30% HTML 28.41% JavaScript 57.84% PHP 0.04% Python 0.08% Shell 0.01% C# 0.31% Less 0.02% ASP.NET 0.01% TSQL 0.01%
asp-net-mvc mvc5-scaffolder

mvc5-scaffolder's Introduction

ASP.NET MVC 5 SmartCode Scaffolding

introduce

ASP.NET MVC 5 SmartCode Scaffolding is an ASP.NET MVC Web application code generation framework integration in Visual Studio.Net development tools, use SmartCode Scaffolding can quickly complete a set of View, Controller and Model, the Service standard code.Reduces programmers from writing repetitive code during system development, and helps team members to follow the same architecture and specifications.Reduce the time of debugging and improve the development efficiency of software projects.。

SmartCode Scaffolding is a custom extension to Visual Studio.net ASP.NET Scaffolding and provides more functionality。

The project has been quietly updating and continuously improving the version since 2014,from Visual Sutdio.Net 2013 to the last 2019 verion .

GITHUB SmartCode Scaffolding qq:942771435

QQ:28440117,email:[email protected],weichat:neostwitter

#Installation & Run

You need to generate code with the WebApp project in the Demo because it references a lot of CSS and HTML templates

Demo Site

Demo
UserName:demo Password:123456 [Demo](http://106.52.105.140:6200/)

Animation7.gif

code generation

Define Entity Class objects and properties

Refer to the EntityFrameWrok Code-First specification definition. The more standard the definition is, the more information you will have for the subsequent generated Code. The following code defines an Order, OrderDetail, one-to-many relationship. When creating the Controller of the Order class, the corresponding code in the Controller, View will be generated based on the associated entity. For example, EditView will generate both the operation on the header Order form and the DataGrid operation on the detail table OrderDetail. The definition of orderDetail refers to Product, many-to-one.The Combox control or DropDownList control and the query method of the Controller layer are generated in the View section。

    //Define field description information, field length, and basic validation rules
    public partial class Order:Entity
    {
        public Order() {
            OrderDetails = new HashSet<OrderDetail>();
        }
        [Key]
        public int Id { get; set; }
        [Required] //提示必填,用红色标注
        [Display(Name = "订单号", Description = "订单号", Order = 1)]
        [MaxLength(12)] //输入长度验证
        [MinLength(12)] //输入长度验证
        [Index(IsUnique =true)]
        public string OrderNo { get; set; }
        [Required] //提示必填
        [Display(Name ="客户名称",Description ="订单所属的客户",Order =1)]
        [MaxLength(30)]
        public string Customer { get; set; }
        [Required]
        [Display(Name = "发货地址", Description = "发货地址", Order = 2)]
        [MaxLength(200)]
        public string ShippingAddress { get; set; }
        [Display(Name = "订单日期", Description = "订单日期默认当天", Order = 3)]
        [DefaultValue("now")] //初始化创建对象时设定默认值
        public DateTime OrderDate { get; set; }
        //关联订单明细 1-*
        public virtual ICollection<OrderDetail> OrderDetails { get; set; }
    }
    public partial class OrderDetail:Entity
    {
        [Key]
        public int Id { get; set; }
        ...
    }

The generated code

  • add controller Animation.gif
  • Generate the following code
Controllers\OrdersController.cs  /* MVC controller */
Repositories\Orders\OrderQuery.cs  /* Define business logic related queries such as paging selection, foreign key/primary key queries */
Repositories\Orders\OrderRepository.cs /* Repository Design patterns */
Services\Orders\IOrderService.cs /*  business logic interfaces  */
Services\Orders\OrderService.cs /*  business logic implementation  */
Views\Orders\Index.cshtml /* The order information DataGrid includes functions such as query/add/delete/modify/import/export */
Views\Orders\_PopupDetailFormView.cshtml /* Order information pops up in an edit window  */

index.html javascript Code snippet
  
OrderController.cs Code snippet
  

Register UnityConfig.cs

        /// <summary>Registers the type mappings with the Unity container.</summary>
        /// <param name="container">The unity container to configure.</param>
        /// <remarks>There is no need to register concrete types such as controllers or API controllers (unless you want to 
        /// change the defaults), as Unity allows resolving a concrete type even if it was not previously registered.</remarks>
        public static void RegisterTypes(IUnityContainer container)
        {
              container.RegisterType<IRepositoryAsync<Order>, Repository<Order>>();
              container.RegisterType<IOrderService, OrderService>();
              container.RegisterType<IRepositoryAsync<OrderDetail>, Repository<OrderDetail>>();
              container.RegisterType<IOrderDetailService, OrderDetailService>();
        }

Runing

Animation2-1.gif

Animation3.gif 以上功能一键生成,包括必填,长度等输入校验规则

System architecture and functionality

component

  • ”Microsoft.AspNet.Mvc” version="5.2.4"
  • “Microsoft.AspNet.Razor“ version="3.2.4"
  • "EasyUI" version="1.4.5"
  • "Hangfire" version="1.6.17"
  • "Unity.Mvc" version="5.0.13"
  • "Z.EntityFramework.Plus.EF6" version="1.7.15"
  • SmartAdmin - Responsive WebApp v1.9.1
  • "EntityFramework" version="6.2.0" 支持Oracle,MySql,Sql Server,PostgreSQL,SQLite,Sybase等 image.png

Practical project

x-TMS Animation4.gif SCRM Animation5.gif MES Animation6.gif

License

Apache License Version 2.0

Copyright 2017 Neo.Zhu

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

mvc5-scaffolder's People

Contributors

neozhu avatar robinli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mvc5-scaffolder's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.