Dapper Source explanation

Source: Internet
Author: User

NuGet downloads the dapper assembly and browses the exposed methods, as shown in

The main explanation: the call procedure of the Execute method,

public static int Execute (this idbconnection CNN, string sql, object param = null, idbtransaction transaction = null, int?) CommandTimeout = null, commandtype? CommandType = null)

This method code:

The Executeimpl method is called internally

, the number is fixed to an array

The ExecuteCommand method is explained below

There are altogether two classes of identity (identity) in the above code, CACHEINFO (cache information)

First, the identity. This class, which is used to commandtext,commandtype,cnn,param a package, is used to uniquely identify these objects. Provides a unique identifier for the caching mechanism.

identity = new Identity (Command.commandtext, Command.commandtype, CNN, NULL, Param. GetType (), NULL);

Then we'll look at this class of Cacheinfo, constructed with the Identity,param,bool parameter.

info = getcacheinfo (identity, param, command. Addtocache);

Here's a look at its constructor:

We then look at the circled method in step 3, which is used to generate a delegate with no return value, and the arguments are ICommand and object

Dapper Source explanation

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.