/// <summary> /// Maps the results of the <paramref name="query"/> to dynamic objects. /// The query is deferred-executed. /// </summary> /// <param name="query">The query.</param> /// <returns>The results of the query as dynamic objects.</returns> /// <seealso cref="Extensions.Map(IDbCommand, TextWriter)"/> public IEnumerable<dynamic> Map(SqlBuilder query) { var mapper = new DynamicMapper { Log = this.Log }; return Extensions.Map<dynamic>(CreateCommand, query, mapper, this.Log); }
/// <summary> /// Maps the results of the <paramref name="query"/> to dynamic objects. /// The query is deferred-executed. /// </summary> /// <param name="query">The query.</param> /// <returns>The results of the query as dynamic objects.</returns> /// <seealso cref="Extensions.Map(IDbCommand, TextWriter)"/> public IEnumerable <dynamic> Map(SqlBuilder query) { var mapper = new DynamicMapper { Log = this.Log }; return(Extensions.Map <dynamic>(CreateCommand, query, mapper, this.Log)); }
/// <inheritdoc cref="Map(IDbCommand)"/> /// <param name="logger">A <see cref="TextWriter"/> used to log when the command is executed.</param> public static IEnumerable<dynamic> Map(this IDbCommand command, TextWriter logger) { var mapper = new DynamicMapper { Log = logger }; return Map(command, r => (dynamic)mapper.Map(r), logger); }
/// <inheritdoc cref="Map(IDbCommand)"/> /// <param name="logger">A <see cref="TextWriter"/> used to log when the command is executed.</param> public static IEnumerable <dynamic> Map(this IDbCommand command, TextWriter logger) { var mapper = new DynamicMapper { Log = logger }; return(Map(command, r => (dynamic)mapper.Map(r), logger)); }
/// <summary> /// Maps the results of the <paramref name="query"/> to dynamic objects. /// The query is deferred-executed. /// </summary> /// <param name="connection">The connection.</param> /// <param name="query">The query.</param> /// <param name="logger">A <see cref="TextWriter"/> used to log when the command is executed.</param> /// <returns>The results of the query as dynamic objects.</returns> public static IEnumerable<dynamic> Map(this DbConnection connection, SqlBuilder query, TextWriter logger) { var mapper = new DynamicMapper(logger); return Map<dynamic>(q => connection.CreateCommand(q), query, mapper, logger); }