I. Summary
1.1, why call this sharing lesson called "Cultivation Handbook"?
I hope this sharing lesson involves some of the little tips and tricks that will help you. I hope that you will be in the future work as a practical skill manual to reserve, in case of a rainy day, once you have encountered with the dapper practice manual similar to the place and scene, can be directly used to browse and flexible application to the project. At last, I suggest that you can constantly improve this manual according to the different usage scenarios you encounter in your work.
Needless to say, directly on dry goods, we do not produce dry goods, we are just dry goods porter.
Iv. knowledge points relating to coverage
1. C # LINQ to XML technology.
2. The handbook of Transact-SQL cultivation. such as how to use temporary tables, create user-defined tables (table), XML data fields, Row_number paging functions, stored procedure practice Manuals (Dynamic execution SQL, exception handling mechanism, transaction mechanism), C # How to get the output of the stored procedure, return parameter value.
3, SQL Sever FOR XML technology (XML PATH, XML RAW, XML Auto Simple usage introduction).
4. Transact-SQL keyword OPENXML the XML document in the Operation memory.
5, Faker.net imitate the test data frame application.
6, vs unit Test nuittest use.
7. The application of dapper in asynchronous programming (Asyn Task).
8, the original dapper simple crud (increase and revise) practice manual. (highly recommended)
9, dapper How to use dynamicparameters dynamic splicing query SQL practice manual. (highly recommended)
10, dapper Expansion library dapper.sqlbuilder, Uniquenamespace.sqlbuilder practice Manual. (highly recommended)
11, the native dapper Advanced skill practice manual. (highly recommended)
12, Dapper Expansion library dapper-extensions practice manual. (highly recommended)
V. Dapper Training Manual online learning and demonstration
5.1, native dapper simple crud (increase and revise) Manual of cultivation
Insert, Insert_batch (BULK insert data).
Update, Delete, Exist.
GetById, GetList, getbyids (in clause use).
Getlistreturndynamic (returns dynamic).
Getlistbymultiquery (returns a multi-result set tuple).
Executewithdbtransaction (local dbtransaction transaction operation).
Executewithtransactionscope (distributed TransactionScope Transaction Operations).
SearchOrdersByPage Dynamicparameterssqlbuild: Get Paging data (by dynamicparameters dynamic stitching Query SQL method stitching + row_number () over clause paging).
SearchOrdersByDynam Icparametersoutputandreturnvaule: How to use dynamicparameters to construct and get stored procedure output, return parameter values, and get stored procedures to return one or more result sets.
5.3. Dapper Expansion Library Dapper.sqlbuilder training manual
Constructs a crud statement template through Sqlbuilder.
Constructs a Select (query), page (pagination) statement template by Sqlbuilder the built-in template.
Getorderonetomanybydappersqlbuilder: Gets the order "one-to-many" through the SQL Syntax XML path clause.
Searchordersbypagedappersqlbuilder: Gets paging data (via Dapper.sqlbuilder stitching + row_number () over clause pagination).
Searchordersbydapperdappersqlbuildersqlpagingtemplates gets paging data (paginated by Dapper.sqlbuilder the built-in paging template).
5.4, the native Dapper Advanced Skill Practice Handbook
Createorder: Create order (with SQL stitching +for loop).
Createorderbystoredprocedures_xmlpath: Create order (in Xmlpath mode that generates XML+SQL XML data type).
Createorderbystoredprocedures_openxml: Create order (in OPENXML mode that generates XML+SQL XML data type).
Createorderbystoredprocedures_customtabletype: Create orders (using SQL users to create custom table types).
Getorderonetomanybysqlbuilder: Get Orders (one-to-many) through the master-slave table SQL statement mode.
Getorderonetomanybydapperquery: Get Orders (one-to-many) through native dapper Query+spliton keywords.
Searchordersbypagesqlbuild: Gets paging data (via SQL statement stitching + row_number () over clause pagination).
Searchordersbypagesqlstoredprocedures: Gets paging data (via SQL paging stored procedure + row_number () over clause paging).
5.5. Dapper Expansion Library Dapper-extensions training manual
1, insert, Insert_batch (BULK insert data).
2, Update, Delete, Exist.
3, insert_batchbysqlbulkcopy (BULK insert data based on the SqlBulkCopy method).
4, GetList: Contains the following knowledge points:
* Query based on criteria (with filters and sort fields).
* Query based on multi-combination criteria (ipredicate predicates.group () to generate filter conditions + sort fields).
* Query based on multi-combination criteria (by Ipredicate.add () to generate filter conditions + sort fields).
* Query based on multiple combinations (predicate multiple conditional compound predicate combinations to generate filter conditions + Sort fields, sample SQL statement: Select * from Table Where ([email protected] and [email protected] ) OR ([email protected] and [email protected]).
* Sub-query query based on single criteria (via Ipredicate.exists () subquery filter condition statement + sort field, sample statement: SELECT * Form table where EXISTS (select 1 from table where [E Mail protected]).
* Sub-query query based on multi-combination conditions (via ipredicate.exists () subquery filter condition statement + sort field, sample statement: SELECT * FROM Table Where EXISTS (select Count (1) from table Where ([email protected] and [email protected]) OR ([email protected] and [email protected])).
*searchordersbypagedapperextensions: Gets the paging data (the built-in count, page function is ipredicate+ by the extended dapperextensions multi-conditional composite predicate provided).
Five, the source code online demonstration and interpretation
View Address Online
Vi. Summary
In the world of ADO, "The sea is wide by diving, the sky high as a bird fly."
The ability to Transact-SQL programming is another step.
A taste of dapper her "beauty"!
After learning this manual, you will be drawn to the full of dry goods, so that you have more confidence!
Follow-up plan: Stupid will follow up the plan to bring you another sharing lesson. NET Lightweight ORM component Dapper, probably including Dapper for Msql,dapper for Mysql, Dapper for Oracle, The repository mode of the data access layer and the application of the warehouse mode based on dapper open source, etc.
If you don't believe it, sweep it.
. NET lightweight ORM components Dapper practice Manual