Skip to content

create overload Query<T> to customize the mapper #360

@mdissel

Description

@mdissel

Add a new overload to Query with an optional parameter Func<IDataRecord, T, T> map
In this function the caller can modify the default mapping with access to the IDataRecord and the result object T

Something like this:

public static IEnumerable<T> Query<T>(
#if CSHARP30
this IDbConnection cnn, string sql, object param, IDbTransaction transaction, bool buffered, int? commandTimeout, CommandType? commandType, Func<IDataRecord, T, T> map
#else
this IDbConnection cnn, string sql, dynamic param = null, IDbTransaction transaction = null, bool buffered = true, int? commandTimeout = null, CommandType? commandType = null, Func<IDataRecord, T, T> map = null
#endif
) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions