BTDB.ODBLayer.RelationsInfo.LoadRelations C# (CSharp) Метод

LoadRelations() приватный Метод

private LoadRelations ( string>.IEnumerable relationNames ) : void
relationNames string>.IEnumerable
Результат void
        internal void LoadRelations(IEnumerable<KeyValuePair<uint, string>> relationNames)
        {
            foreach (var name in relationNames)
            {
                _name2Id[string.Intern(name.Value)] = name.Key;
                if (name.Key >= _freeId) _freeId = name.Key + 1;
            }
        }

Usage Example

Пример #1
0
        public void Open(IKeyValueDB keyValueDB, bool dispose, DBOptions options)
        {
            _keyValueDB = keyValueDB ?? throw new ArgumentNullException(nameof(keyValueDB));
            _dispose    = dispose;
            _type2Name  = options.CustomType2NameRegistry ?? new Type2NameRegistry();
            _polymorphicTypesRegistry = new PolymorphicTypesRegistry();
            AutoRegisterTypes         = options.AutoRegisterType;
            ActualOptions             = options;
            SymmetricCipher           = options.SymmetricCipher ?? new InvalidSymmetricCipher();

            _tableInfoResolver     = new TableInfoResolver(keyValueDB, this);
            _tablesInfo            = new TablesInfo(_tableInfoResolver);
            _relationsInfoResolver = new RelationInfoResolver(this);
            _relationsInfo         = new RelationsInfo(_relationsInfoResolver);

            using var tr = _keyValueDB.StartTransaction();
            _lastObjId   = (long)tr.GetUlong(0);
            _lastDictId  = tr.GetUlong(1);
            if (_lastObjId == 0)
            {
                if (tr.FindLastKey(AllObjectsPrefix))
                {
                    _lastObjId = (long)PackUnpack.UnpackVUInt(tr.GetKey().Slice(AllObjectsPrefixLen));
                }
            }
            _tablesInfo.LoadTables(LoadTablesEnum(tr));
            _relationsInfo.LoadRelations(LoadRelationNamesEnum(tr));
            if (_lastDictId == 0)
            {
                if (tr.FindExactKey(LastDictIdKey))
                {
                    _lastDictId = PackUnpack.UnpackVUInt(tr.GetValue());
                }
            }
        }
All Usage Examples Of BTDB.ODBLayer.RelationsInfo::LoadRelations