ABP Basic Practice training, a simple blog (add a check) and other functions:

Source: Internet
Author: User

Recently the company's project to switch to ABP framework, had to start to try, first get a simple blog to try Taker, we can go to the Sun-Rui Big blog To see About the ABP introduction bar.

-: Download sample template to ABP website;

Here are a few options, first of all we use the mvc5.x, and then select the classic multi-page program, fill in the project name and verification code, click the Create button below.

Second: Initialize your program;
1: After opening to see the ABP architecture, according to my understanding is probably divided into these several layers. To see if there is no lack of us first to NuGet restore;

2: Click to restore NuGet bag ~

3: Using Codefirst to generate the database ~ ~

Change Data Link

Because I am using a local database, so I use the system authentication directly, please change the database link by yourself.

Input Update-database
If the update occurs incorrectly, check to see if the program is running with errors or if the data link is correct. You should be able to open it here. Click to run ~ ~ Account password is: admin 123qwe tenant Default, the latest version of ABP Best Use vs2017 run.

4: Create a new entity


First open the domain layer, create a new file folder named Random, in the directory to build an entity class, I simply create a column, inherited entity will default to use the ABP defined primary key, the default is the ID int type, then update the new good entity to the database.

First go to DbContext to define the corresponding dbset of the entity, add the new entity to the Blogabpdbcontext

Open the Package control console Enter the "add-migration 20171127_channel" command, enter the migrations file at the infrastructure level to see if the file is generated, if there is an execute command to update the "Update-database" When the update is successful, the database automatically creates a new table.

After the entity is created, the most important part is the one that will be described in detail in the next Application service layer.

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.