internal override void Load(byte[] data, DBMapping mapping) { using (MemoryStream mStream = new MemoryStream(data)) using (BinaryReader reader = new BinaryReader(mStream)) { Index = reader.ReadInt32(); int count = reader.ReadInt32(); for (int i = 0; i < count; i++) { T ob = new T { Collection = this }; Binding.Add(ob); ob.RawData = reader.ReadBytes(reader.ReadInt32()); ob.Load(mapping); if (ob.ForeignKeys != null) { Session.KeyedObjects.Enqueue(ob); } Dictionary[ob.Index] = ob; } } VersionValid = mapping.IsMatch(Mapping); }
internal override void Load(byte[] data, DBMapping mapping) { VersionValid = mapping.IsMatch(Mapping); using (MemoryStream mStream = new MemoryStream(data)) using (BinaryReader reader = new BinaryReader(mStream)) { Index = reader.ReadInt32(); int count = reader.ReadInt32(); for (int i = 0; i < count; i++) { T ob = new T { Collection = this }; Binding.Add(ob); ob.RawData = reader.ReadBytes(reader.ReadInt32()); ob.Load(mapping); } } }