Skip to content

SqlMapper class

namespace: Serenity.Data   assemblySerenity.Net.Services

Provides IDbConnection extension methods that wrap the corresponding Dapper SqlMapper methods, translating Serenity SQL (dialect specific brackets and parameter prefixes) via Translate and ensuring the connection is open before execution. It mirrors the string based Execute and Query extension methods of Dapper's SqlMapper, not every Dapper overload (CommandDefinition based methods, ExecuteScalar, ExecuteReader, QueryFirst, QueryMultiple, async variants, etc.). The ISqlQuery overloads are Serenity specific and have no Dapper equivalent. Note that unlike SqlHelper methods, these extension methods do not go through ISqlOperationInterceptor.

public static class SqlMapper

Public Members

name description
static Execute(…) Executes a parameterized SQL statement.
static Query(…) Returns a list of dynamic objects; the reader is closed after the call. (2 methods)
static Query<T>(…) Returns a list of objects; the reader is closed after the call. (2 methods)

See Also