Exemplo n.º 1
0
        public static Func <ISpecContext, IEnumerable <Dictionary <string, object> > > ToSource(IField[] fields, DatabaseFixture fixture, IDbCommandBuilder builder)
        {
            if (builder == null)
            {
                return(c => c.State.CurrentObject.As <IEnumerable <Dictionary <string, object> > >());
            }

            return(c =>
            {
                var runner = fixture.Runner;
                var buffer = new BufferedReader(fields);

                var cmd = builder.BuildCommand(runner);

                using (var reader = runner.ExecuteReader(cmd))
                {
                    return buffer.Read(reader);
                }
            });
        }
Exemplo n.º 2
0
 public DbSetExecution(BufferedReader reader)
 {
     _reader = reader;
 }