In this section we are going to set up the System Administrator table, but before releasing it, I will publish a code generator for everyone to use first.
This generator is for this project, theory cannot be used for other projects, and it is written in a rather sloppy, but can be used
Interested in the generator source code in the group can be obtained, I have uploaded to the group file, decompression code generator open App.CodeHelper.exe
Edit the database link at the bottom, change it to the database you want to generate, and the menu bar on the left is the database table you want to generate:
The code generator is simple enough to generate code for all layers. The generated models layer has the error of writing a custom validation, you can remove it yourself
About custom validation Everyone is interested to find other articles. Here I customize the validation, I did not publish, Ok, we select the Sysuser table on the left to generate all the layer code of the project
According to the truth, everyone is very familiar with the document should be put in the project. I don't have to send out the code, it's in the generator.
This section is more interesting, of course, you have to add the system administrator in the Sysmodels menu
Preview the effect: The code is created perfectly, and you can modify the generator according to your own code.
We can generate a simple function without writing a single line of code. Includes lists, create, and modify.
Build a backend management system for ASP. Mvc4+ef5+easyui+unity2.x Injection (25)-Rights management System-system administrator (with generator)