Ejemplo n.º 1
0
        public void TestReflection()
        {
            IRowMapper<TestObject> rm = new TestObjectRowMapper();

            NamedResultSetProcessor<TestObject> rsp = new NamedResultSetProcessor<TestObject>("Test", rm);

            IDictionary dict = new Hashtable();
            dict.Add("Test", rsp);
            DoWork(dict);
        }
Ejemplo n.º 2
0
        public void TestReflection()
        {
            IRowMapper <TestObject> rm = new TestObjectRowMapper();

            NamedResultSetProcessor <TestObject> rsp = new NamedResultSetProcessor <TestObject>("Test", rm);

            IDictionary dict = new Hashtable();

            dict.Add("Test", rsp);
            DoWork(dict);
        }
Ejemplo n.º 3
0
        public IList <T> QueryWithRowMapper <T>(params object[] inParameterValues)
        {
            ValidateParameters(inParameterValues);
            if (resultProcessors.Count == 0)
            {
                throw new InvalidDataAccessApiUsageException("No row mapper is specified.");
            }

            NamedResultSetProcessor <T> resultSetProcessor = resultProcessors[0] as NamedResultSetProcessor <T>;

            if (resultSetProcessor == null)
            {
                throw new InvalidDataAccessApiUsageException("No row mapper is specified.");
            }

            if (resultSetProcessor.RowMapper == null)
            {
                throw new InvalidDataAccessApiUsageException("No row mapper is specified as first result set processor.");
            }
            IDictionary outParams = Query <T>(inParameterValues);

            return(outParams[resultSetProcessor.Name] as IList <T>);
        }