Exemplo n.º 1
0
        internal QueryBuilder(IWrapper <TWrapper> command, Func <object> commandResultAccessor, RowGroup rowGroup)
        {
            Check.IsNotNull(command, nameof(command));
            Check.IsNotNull(commandResultAccessor, nameof(commandResultAccessor));
            Check.IsNotNull(rowGroup, nameof(rowGroup));

            this.command = command;
            this.commandResultAccessor = commandResultAccessor;
            this.rowGroup = rowGroup;
        }
Exemplo n.º 2
0
        public QueryBuilder <TWrapper> Query <TWrapper>(Func <TDb, IWrapper <TWrapper> > commandFactory)
            where TWrapper : SqlServerQueryCommand, IWrapper <SelectClause>
        {
            Check.IsNotNull(commandFactory, nameof(commandFactory));

            var command = commandFactory(db);

            commands.Add(command);

            var index       = commands.Count - 1;
            var queryResult = new RowGroup(index.ToString(), Enumerable.Empty <string>(), true);

            queryResults.Add(x => queryResult.Apply(x));

            return(new QueryBuilder <TWrapper>(command, () => result?[index], queryResult));
        }
Exemplo n.º 3
0
 public void AddChild(RowGroup rowGroup)
 {
     children.Add(rowGroup);
 }