Ecommon.dapper Lightweight Dapper Extension

Source: Internet
Author: User

We all know dapper this ORM framework, but we also know that his extension is currently not particularly good, and today I recommend a lightweight, easy-to-use extension called

Ecommon.dapper, it is a class library of Ecommon, about Ecommon, it is enode a common infrastructure, then you have a problem, Enode is what?

I'm actually going to say it's Dapper, that's the point. About Enode, go left turn = " portal

One: Why Choose Ecommon.dapper1. Easy to use, no threshold to get started: #查询

For the habit of using EF we suddenly found that with good cool there are wood there

Of course, some people will question the high flexibility of SQL Ah, I just need to return a few of the fields in the table you change that.

I'm big SQL, just need to change the SQL statement on the line, right?

This situation. How could I have never thought of my soup?

The same supports have wood there. And of course you said the complex SQL statement. This one?

You know too much.

This is a lightweight extension ah. Heavy-weight applications you're still using the native.

#添加

At this time the careful children's shoes found. I have added a catgoryid to my SQL statement. And why is this?

Because I have this field in the table is not written will be an error, as to why? Because you want to specify the field you are updating in front of the values.

Like this

SQL Basic Skills Forget the silently go back to fill the SQL bar

#更新

From the code above, we can see that native notation and updates are just the same as executing the Execute method.

And the Ecommon is the corresponding parameter can be passed. The first parameter is the updated field, and the second is the condition. The third one is the table name

For all parameters

#删除

Delete Native no suspense, or execute function.

And the Ecommon parameter only needs to pass the corresponding condition field on the line.

For all fields

2. Lightweight and easy to modify:

The entire CS file has only 400 rows of wood there. Take a easy look again. No threshold according to their own needs to modify the custom has wood has

two: Using Ecommon.dapper

Specifically how to use the above has been introduced in very detailed, then I will briefly say how to configure and use the

Way One:

NuGet Package Get Ecommon

namespaces add using Ecommon.dapper; It can be used both

Way Two

Copy the source code directly into the project

Transmission Door

There is wood to find very simple. Give it a try.

Ecommon.dapper Lightweight Dapper Extension

Related Article

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.