Get the App
SLTechnology News&Howtos  ›  Development  › 

How to build the Rapid Development Framework of ASP.NET MVC Bootstrap

Shulou Source: shulou.com Published: 2022-06-02 20:27:50 09月18日 Update

In this issue, the editor will bring you about how to build the ASP.NET MVC Bootstrap rapid development framework. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

Preface

Every new development project has to be designed from scratch? Is there a general rapid development framework? And it has to be ASP.NET MVC And Bootstrap? Do not create the database by hand? Does the framework have good scalability for future business support? Does it take one day to build a basic environment for such a simple function? Can you only care about the business I need?

There is such a project, based on the rapid project development framework of ASP.NET MVC, EntityFramework, Memcached, Bootstrap, it only takes 3 seconds to create a project with simple user management.

One-click installation

Lazy people click to install the package download address, double-click the "install.bat" batch to add the template project to the VS project template list.

Extreme speed creation

Just click the OK button to create a daemon with simple user management and login functions, as shown in the following figure:

Operating effect login interface

Manage the background main interface

User management

Automatically created database

Export your own project template

Export a sample screenshot of the project template:

The source code highlights the service interface layer, completely rejecting the junk and redundant code of BLL.

Service abstract base class public abstract class ServiceContext: IDisposable {/ database operation context / public readonly DefaultDbContext DbContext = new DefaultDbContext (); / caching component / public CacheContext CacheContext {get; private set } / dynamically set a new instance of the cache object / cache instance object public void SetCacheInstance (CacheContext cacheContext) {/ / release the existing cache component if (CacheContext! = null) {CacheContext.Dispose () CacheContext = null;} / / initialize the new instance of the cache component CacheContext = cacheContext;} public void SetCacheInstance (Type cacheContextType) {if (cacheContextType = = null) {throw new ArgumentNullException ("cacheContextType") } if (! typeof (CacheContext) .IsAssignableFrom (cacheContextType)) {throw new ArgumentException (string.Format (CultureInfo.CurrentCulture, "this type {0} must inherit from abstract class CacheContext", cacheContextType), "cacheContextType") } try {CacheContext = Activator.CreateInstance (cacheContextType) as CacheContext } catch (Exception ex) {throw new InvalidOperationException (String.Format (CultureInfo.CurrentCulture, "failed to create an instance of abstract class CacheContext {0}", cacheContextType) Ex) }} public void Dispose () {if (DbContext! = null) {DbContext.Dispose ();} if (CacheContext! = null) {CacheContext.Dispose () } caching components that can be dynamically switched during operation

Specific business implementation of service interface layer

Have a penchant for cleanliness of the new keyword? In deep pain and evil?

All interfaces are configured.

Don't get away with anything unusual.

Wait every day under the tree, in the hope that a hare would kill itself by crashing into a tree trunk

The basic framework of the project provides you with a quick start, and more NB design requires further imagination.

The above is how to build the ASP.NET MVC Bootstrap rapid development framework shared by the editor. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Tags: Project framework cache development instance template component management business interface data database user service content function dynamic just background object Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Docker NVidia MySQL Microsoft