public EsentGeometryStoreReader(EsentModel esentModel)
        {
            _esentModel               = esentModel;
            _shapeGeometryCursor      = _esentModel.GetShapeGeometryTable();
            _shapeInstanceCursor      = _esentModel.GetShapeInstanceTable();
            _shapeGeometryTransaction = _shapeGeometryCursor.BeginReadOnlyTransaction();
            _shapeInstanceTransaction = _shapeInstanceCursor.BeginReadOnlyTransaction();
            _regionsList              = new XbimContextRegionCollection();
            IXbimShapeGeometryData regions = new XbimRegionCollection();

            if (_shapeGeometryCursor.TryMoveFirstRegion(ref regions))
            {
                do
                {
                    _regionsList.Add((XbimRegionCollection)regions);
                    regions = new XbimRegionCollection();
                } while (_shapeGeometryCursor.TryMoveNextRegion(ref regions));
            }
            if (!_regionsList.Any()) //we might have an old xbim database regions were stored in the geometry table
            {
                var legacyCursor = _esentModel.GetGeometryTable();
                using (var txn = legacyCursor.BeginReadOnlyTransaction())
                {
                    foreach (var regionData in legacyCursor.GetGeometryData(Xbim.Common.Geometry.XbimGeometryType.Region))
                    {
                        _regionsList.Add(XbimRegionCollection.FromArray(regionData.ShapeData));
                    }
                }
                _esentModel.FreeTable(legacyCursor);
            }
            _contextIds = new HashSet <int>(ContextIds);
        }
 internal XbimReadTransaction(EsentModel theModel, EsentReadOnlyTransaction txn)
 {
     Model            = theModel;
     _readTransaction = txn;
     InTransaction    = true;
 }