public T[] ExecuteAndRead <T>(IRowCreator <T> creator, string sql, params SqlParameter[] parameters)
        {
            var rows = new List <T>();

            using (var cmd = PrepareCommand(sql, parameters))
            {
                using (var reader = cmd.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        var row = creator.CreateInstance(reader);
                        rows.Add(row);
                    }
                }
            }

            return(rows.ToArray());
        }
Esempio n. 2
0
 private void CreateInstances()
 {
     _primeGenerator = new PrimeGenerator();
     _rowCreator     = new RowCreator(_primeGenerator);
     _gridCreator    = new GridCreator(_rowCreator);
 }
 // ===============================================================================
 //                                                                     Constructor
 //                                                                     ===========
 public InternalBeanArrayMetaDataResultSetHandler(IBeanMetaData beanMetaData, IRowCreator rowCreator, IRelationRowCreator relationRowCreator)
     : base(beanMetaData, rowCreator, relationRowCreator)
 {
 }
        //creates a data row object from a csv file input

        public CsvToDataFile(IRowCreator rowCreator)
        {
            _rowCreator = rowCreator;
        }
Esempio n. 5
0
 public void TestCaseSetup()
 {
     _primeGenerator = new PrimeGenerator();
     _rowCreator     = new RowCreator(_primeGenerator);
 }
Esempio n. 6
0
 public void TestInitialise()
 {
     _primeGenerator = new PrimeGenerator();
     _rowCreator     = new RowCreator(_primeGenerator);
 }
Esempio n. 7
0
 public GridCreator(IRowCreator rowCreator)
 {
     _rowCreator = rowCreator;
 }
Esempio n. 8
0
        protected IRelationRowCreator _relationRowCreator;                                  // [DAONET-56] (2007/08/29)

        // ===============================================================================
        //                                                                     Constructor
        //                                                                     ===========
        public InternalAbstractBeanMetaDataResultSetHandler(IBeanMetaData beanMetaData, IRowCreator rowCreator, IRelationRowCreator relationRowCreator)
        {
            _beanMetaData       = beanMetaData;
            _rowCreator         = rowCreator;
            _relationRowCreator = relationRowCreator;
        }