GetByEnvelope() public method

Get all geometries inside the envelope from a featureClass
public GetByEnvelope ( string featureClassName, IEnvelope envelope ) : IEnumerable
featureClassName string FeatureClass name
envelope IEnvelope Envelope
return IEnumerable
        public void TestMethod1()
        {
            int percent = 0;

            var repository = new SdeRepository("srvprodist", "5151", "bdgd", "bdgd", "sde.DEFAULT");
            var cache = new InMemoryCache(repository, repository.GetFullExtent("admgid.Switch_PT"), "admgid.Switch_PT");

            cache.OnProgress += delegate(int i)
                {
                    percent = i;
                };

            cache.BuildAllCache();

            IList<IGeometry> list = new List<IGeometry>();

            var envelop = new Envelope(325017, 320003, 7392018, 7391712);
            IEnvelope affected = null;

            var inicio = DateTime.Now;
            var result = cache.RetriveData(envelop, ref list, ref affected);
            var tempo1 = (DateTime.Now - inicio).TotalMilliseconds;

            inicio = DateTime.Now;
            var fromSde = repository.GetByEnvelope("admgid.Switch_PT", envelop);
            var tempo2 = (DateTime.Now - inicio).TotalMilliseconds;

            Assert.AreEqual(list.Count, fromSde.Count());
            Assert.IsTrue(tempo1 < tempo2);
            Assert.AreEqual(percent, 100);
        }
        public void Method01()
        {
            var sde = new SdeRepository("srvprodist", "5151", "bdgd", "bdgd", "sde.DEFAULT");
            var nosql = new MongoRepository();

            var cache = new NoSqlCache(sde, nosql, "admgid.Switch_PT");
            cache.BuildAllCache();

            IList<IGeometry> list = new List<IGeometry>();

            var envelop = new Envelope(325017, 320003, 7392018, 7391712);
            IEnvelope affected = null;

            var inicio = DateTime.Now;
            var result = cache.RetriveData(envelop, ref list, ref affected);
            var tempo1 = (DateTime.Now - inicio).TotalMilliseconds;

            inicio = DateTime.Now;
            var fromSde = sde.GetByEnvelope("admgid.Switch_PT", envelop);
            var tempo2 = (DateTime.Now - inicio).TotalMilliseconds;

            Assert.AreEqual(list.Count, fromSde.Count());
            Assert.IsTrue(tempo1 < tempo2);
        }