Real SqlHelper, make the program write SQL is also so beautiful

Source: Internet
Author: User

Real SqlHelper, make the program write SQL is also so beautiful

Writing SQL statements in a program is something that programmers often do, a string of long strings that are completely written by the keyboard, error-prone, and inefficient, and the smart hints of the development tool cannot detect errors in the SQL string being written.

If you have a tool that makes writing SQL as easy as writing a program, this looks like this:

Do you want to try it?

First step: Use the NuGet Package Manager to reference Rc.PetaPoco.T4

After successful installation, the project has more models folder, the folder contains T4 template files.

Configure the connection string in Web. config or app. config, and fill in the string's name in the connectionStringName value in Database.tt after the configuration is complete. As shown in the following:

When the configuration is complete and the Database.tt file is saved, the VS development tool generates the entity class as shown in:

Step two: Use the NuGet Package Manager to reference Rc.petapoco

After the installation is complete, you can try it out using the following instructions:

1. Defining the SqlHelper Helper instance

2. Single-table query

3. Correlation table query, support Leftjoin, Rightjoin, Innerjoin, maximum of 9 tables

4. Update the table

5. Delete a table

Real SqlHelper, make the program write SQL is also so beautiful

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.