How does Dapper create a DbCommand
-instance of the specific ADO.Net
driver using the DbConnection
instance?
For example if i use SAConnection
, how does Dapper
create an instance of SACommand
when querying data?
Sample
using (iAnywhere.Data.SQLAnywhere.SAConnection connection =
DAL.ConnectionManager
.GetOpenPoolConnection<iAnywhere.Data.SQLAnywhere.SAConnection>())
{
connection.Execute("INSERT INTO Table1 (FallbackLanguageID, Guid)
VALUES (?, ?)", new { fallbackLanguageID, newLocalizationGroup });
}
Each specific DBConnection
implements an IDBConnection
interface, which has a CreateCommand
method. Dapper just calls that.