示例#1
0
        protected override IDataReader ExecuteReader <T>(IQueryModel <T> model, IQueryBuilder <T> builder, ITransaction <SqlConnection> transaction)
        {
            var commandText = SqlQueryRenderer.Render(model, builder);

            var connection = transaction.GetConnection();
            var command    = new SqlCommand(commandText, connection);
            var parameters = command.Parameters;

            foreach (var p in builder.GetParameters())
            {
                parameters.AddWithValue(p.Key, p.Value);
            }

            var sqlReader = command.ExecuteReader();

            return(new HierarchicSqlDataReader(sqlReader, null));
        }
示例#2
0
 public override string GetQueryText <T>(IQueryModel <T> model, IQueryBuilder <T> builder)
 {
     return(SqlQueryRenderer.Render(model, builder));
 }