Developing a project at the end of 16, the project for auction, Snow is a challenge for me, a non-programmer. Program Ape the industry is to learn to use old. Individuals prefer SQL Native writing, EF still not cold, ef although strong, but it is not easy to use. At the same time the method of Dapper asynchronous async, measured repeatedly or decided to use Dapper, because the company used the MSSQL so in this is based on MSSQL grammar.
Dapper Source: https://github.com/StackExchange/dapper-dot-net
I. Project References
Direct search in NuGet Add reference
Second, basic grammar
1. Add references in the class library
Individuals prefer to write native SQL, although handwriting is less efficient, but can keep the code fun. Of course, many times also use tool software to generate additions and deletions of the statement ...
The basic syntax is no longer mentioned, the parameterization, transaction, multi-statement query
(1) Parameterization:
Dapper used to be,
Dynamicparameters p = new Dynamicparameters ();
Use the following method
(2) Execution of services
Here the two strSQL is the Update method, the entire process: Open link-open transaction-execution Method-Error rollback/Successful commit-close link, Ps:dapper also have Dbconnection.dispose () method, with colleagues to remind the best or directly close.
(3) Multi-statement query
To reduce the number of database queries, request multiple data at one time
Like other Orm, Dapper also requires entities to correspond to data fields.
Many dapper methods do not say much.
First knowledge of Dapper