public void ReadObject(BinSerializer bs)
        {
            uint propIndex;

            do
            {
                propIndex = bs.ReadUInt32();
                switch (propIndex)
                {
                case 1: _storeType = (EntityStoreType)bs.ReadByte(); break;

                case 2: OrderByDesc = bs.ReadBoolean(); break;

                case 3: SchemaVersion = bs.ReadUInt32(); break;

                case 4:
                {
                    int count = bs.ReadInt32();
                    for (int i = 0; i < count; i++)
                    {
                        var idx = (EntityIndexModel)bs.Deserialize();
                        Indexes.Add(idx);
                    }
                }
                break;

                case 5:
                {
                    int count = bs.ReadInt32();
                    PartitionKeys = new PartitionKey[count];
                    for (int i = 0; i < count; i++)
                    {
                        PartitionKeys[i].MemberId     = bs.ReadUInt16();
                        PartitionKeys[i].OrderByDesc  = bs.ReadBoolean();
                        PartitionKeys[i].Rule         = (PartitionKeyRule)bs.ReadByte();
                        PartitionKeys[i].RuleArgument = bs.ReadInt32();
                    }
                }
                break;

                case 6: _devIndexIdSeq = bs.ReadByte(); break;

                case 7: _usrIndexIdSeq = bs.ReadByte(); break;

                case 8: _oldSchemaVersion = bs.ReadUInt32(); break;

                case 0: break;

                default: throw new Exception($"Deserialize_ObjectUnknownFieldIndex: {GetType().Name} at {propIndex} ");
                }
            } while (propIndex != 0);
        }
Beispiel #2
0
 /// <summary>
 /// New EntityModel for system store
 /// </summary>
 internal EntityModel(ulong id, string name, EntityStoreType storeType, bool orderByDesc = false) : base(id, name)
 {
     Members      = new List <EntityMemberModel>();
     StoreOptions = new SysStoreOptions(storeType, orderByDesc);
 }
 internal SysStoreOptions(EntityStoreType storeType, bool orderByDesc)
 {
     _storeType  = storeType;
     OrderByDesc = orderByDesc;
 }