Esempio n. 1
0
        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);
            }
        }
 protected virtual IDictionary QueryByNamedParam(IDictionary inParams)
 {
     ValidateNamedParameters(inParams);
     return(AdoTemplate.QueryWithCommandCreator(NewCommandCreator(inParams), resultProcessors));
 }
 protected virtual IDictionary Query(params object[] inParameterValues)
 {
     ValidateParameters(inParameterValues);
     return(AdoTemplate.QueryWithCommandCreator(NewCommandCreatorWithParamValues(inParameterValues), resultProcessors));
 }