Editing Dapper
Revision as of 14:52, 2 October 2023 by User (talk | contribs) (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...")
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.