Inheritance: System.Data.Common.DbDataReader
Esempio n. 1
0
        public void Test11()
        {
            var fakeReader = new FakeReader();
            var pocoDataFactory = new PocoDataFactory(new MapperCollection());
            var newPropertyMapper = new PropertyMapper();
            var pocoData = pocoDataFactory.ForType(typeof(NestedConvention));
            newPropertyMapper.Init(fakeReader, pocoData);
            newPropertyMapper.Map(fakeReader, new RowMapperContext() { PocoData = pocoData });

            var sw = Stopwatch.StartNew();

            for (int j = 0; j < 1000; j++)
            {
                newPropertyMapper = new PropertyMapper();
                newPropertyMapper.Init(fakeReader, pocoData);

                for (int i = 0; i < 1000; i++)
                {
                    newPropertyMapper.Map(fakeReader, new RowMapperContext() { PocoData = pocoData });
                }
            }

            sw.Stop();

            Console.WriteLine("Elapsed Time (ms): {0}", sw.ElapsedMilliseconds);
            //250
        }
Esempio n. 2
0
        public void Test11()
        {
            var fakeReader        = new FakeReader();
            var pocoDataFactory   = new PocoDataFactory(new MapperCollection());
            var newPropertyMapper = new PropertyMapper();
            var pocoData          = pocoDataFactory.ForType(typeof(NestedConvention));

            newPropertyMapper.Init(fakeReader, pocoData);
            newPropertyMapper.Map(fakeReader, new RowMapperContext()
            {
                PocoData = pocoData
            });

            var sw = Stopwatch.StartNew();

            for (int j = 0; j < 1000; j++)
            {
                newPropertyMapper = new PropertyMapper();
                newPropertyMapper.Init(fakeReader, pocoData);

                for (int i = 0; i < 1000; i++)
                {
                    newPropertyMapper.Map(fakeReader, new RowMapperContext()
                    {
                        PocoData = pocoData
                    });
                }
            }

            sw.Stop();

            Console.WriteLine("Elapsed Time (ms): {0}", sw.ElapsedMilliseconds);
            //250
        }