"Build your own. NET Core API Framework from scratch" (iii) Integrated lightweight orm--sqlsugar:3.1 Build environment

Source: Internet
Author: User

First, there are two ways to introduce Sqlsugar to a project:

1) Use the NuGet guide package directly

2) GitHub download source code, then project reference

The second is chosen here.

After the introduction of success, we need to configure the environment according to their own habits, such as database connection string How to put, how convenient to use Sqlsugar for crud.

First look at the database connection string, I put it in the BaseDBConfig.cs,

(It is customary to put it in the system configuration file, the. NET core environment, the Web. config mechanism is removed, the configuration is used to store JSON files, about the use of JSON read-write configuration information after a chapter dedicated)

And then the most important BaseDB.cs:

The Basedb class now places only one function called Getclient (), which returns a Sqlsugarclient class, which is the key to crud.

This chapter is simple to configure to this, the next chapter to combat the actual use of the existing framework, quickly write a student class of additions and deletions to check.

"Build your own. NET Core API Framework from scratch" (iii) Integrated lightweight orm--sqlsugar:3.1 Build environment

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.