Dapper: Revision history

Jump to navigation Jump to search

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

3 October 2023

2 October 2023

  • curprev 14:5214:52, 2 October 2023User talk contribs 679 bytes +679 Created page with "<strong>Example:</strong> <pre>var dbConn = dbContext.Database.GetDbConnection(); if (dbConn.State != ConnectionState.Open) { await dbConn.OpenAsync(); } return await dbConn.QueryAsync<FooDTO>(@" SELECT f.foo_id AS FooId, f.name AS Name FROM dbo.Foo f WHERE f.foo_id = @fooId ", new { fooId, });</pre> <strong>Do not hard code</strong> the database name. In the service class that extends BaseService, you can call GetDatabase("id") to get the ten..."