public void TestQueryWithCommandCreators()
        {
            IDbCommandCreatorFactory ccf         = new IDbCommandCreatorFactory(adoTemplate.DbProvider, CommandType.Text, "select TestObjectNo, Age, Name from TestObjects", null);
            IDbCommandCreator        cc          = ccf.NewDbCommandCreator(null);
            IList <TestObject>       testObjects = adoTemplate.QueryWithCommandCreator(cc,
                                                                                       new TestObjectResultSetExtractor <List <TestObject> >());

            Assert.IsNotNull(testObjects);
            Assert.AreEqual(2, testObjects.Count);
            foreach (TestObject o in testObjects)
            {
                Console.WriteLine(o);
            }
        }
Esempio n. 2
0
 protected virtual IDbCommandCreator NewCommandCreator(IDictionary inParams)
 {
     return(commandFactory.NewDbCommandCreator(inParams));
 }