Dapper is an ORM framework under .NET. According to the official tutorial, it is easy to get started, I am not too deep in use, I used the DapperExtensions extension, the introduction is as follows:
A small library that complements Dapper by adding basic CRUD operations (get, insert, update, delete) to your POCO. For more advanced query scenarios, Dapper Extensions provides a predicate system. Through the code, you can perform simple addition, deletion, modification and query operations on the table, what if we want to get the executed SQL statement?
The code is as follows:
Calling Code:
Generated SQL statement:
[ExecuteReader(SequentialAccess)] SELECT TOP(10) [_proj]. [Id], [_proj]. [RecommendIds], [_proj]. [Count], [_proj]. [Language], [_proj]. [_CreateTime], [_proj]. [_UpdateTime] FROM (SELECT ROW_NUMBER() OVER(ORDER BY [itsvse].[ Id] DESC) AS [_row_number], [itsvse]. [Id], [itsvse]. [RecommendIds], [itsvse]. [Count], [itsvse]. [Language], [itsvse]. [_CreateTime], [itsvse]. [_UpdateTime] FROM [itsvse]) [_proj] WHERE [_proj]. [_row_number] >= @_pageStartRow ORDER BY [_proj]. [_row_number]
EF has two ways to obtain SQL statements generated by the ORM framework, the tutorial is as follows:
|