Overview of CRUD full-stack programming

Source: Internet
Author: User

Business Scenarios

CRUD, from a data-driven point of view, almost all of the business is doing such a thing.
Almost all operations are done on the table and additions and deletions should be checked.
Let's say we have a database data class:
It is divided into basic/configuration data and business/growth data, or static and dynamic data.
Where the static data is generated by the editor of the background administrator, the dynamic data is generated by the customer.
Then the static data in this part is often accompanied by the complete deletion and modification of the logic.
Complete and delete and change the logic refers to the database of a table data query.
The addition, deletion, modification of one or more pieces of data.
A bit more straightforward is the interface, which has a query, add, delete, modify, import, Export button.

Design description

I made this design for the above situation, technically using ASP. NET MVC and EntityFramework's Codefirst mode.

Because of the database design from the Web interface to the lowest level, I call it crud, all-stack design.

Overall architecture:

Brief description:

Listlayout is a layout page for a list page
Addoreditlayout is the layout page for adding and modifying pages
Crudcontroller is the base class for all controllers, inherited from controller
Where ViewModel is the model of the generic extension, this is the dimension that must be
Searchmodel is the dimension of the query entity for the generic extension, which is optional
Ordermodel is the dimension of the generic extended sort entity, optional
Icrudservice is the parent interface for all service interfaces
Three of these are generic extended dimensions, like Curdcontroler
Curdservice is the base class for all services and inherits from Icrudservice, where entity is Efcodefirst
Repository here borrowed the Repository design from Nlayerapp.
The SortExpression part borrowed the design in the Apworks
DB Here we use Codefirst, db I understand the equivalent of EF DbContext

Subsequent

There will be several articles detailing this design in succession

1, the design of the data layer
2, the design of the service layer
3, the design of the controller
4, the design of the view
Extension of the 5,MVC
6, import the exported design
7, more streamlined design
8, summary

Overview of CRUD full-stack programming

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.