- Timestamp:
- 03/03/17 11:41:43 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/Mapper.cs
r14594 r14711 139 139 bundle.RootBoxId = mapper.GetBoxId(o); 140 140 bundle.AddRangeTransformerGuids(mapper.transformers.GetValues().Select(x => x.Guid).Select(x => ByteString.CopyFrom(x.ToByteArray()))); 141 bundle.AddRangeTypeGuids(mapper.types.GetValues().Select(x => x.AssemblyQualifiedName ?? x.Name).Select(x => ByteString.CopyFromUtf8(x)));141 bundle.AddRangeTypeGuids(mapper.types.GetValues().Select(x => ByteString.CopyFrom(StaticCache.GetGuid(x).ToByteArray()))); 142 142 bundle.AddRangeStrings(mapper.strings.GetValues()); 143 143 bundle.AddRangeBoxes(mapper.boxId2Box.OrderBy(x => x.Key).Select(x => x.Value)); … … 146 146 public static object ToObject(Bundle bundle) { 147 147 var mapper = new Mapper(); 148 mapper.types = new Index<Type>(bundle.TypeGuidsList.Select(x => x.ToStringUtf8()).Select(x => Type.GetType(x)));148 mapper.types = new Index<Type>(bundle.TypeGuidsList.Select(x => StaticCache.GetType(new Guid(x.ToByteArray())))); 149 149 mapper.strings = new Index<string>(bundle.StringsList); 150 150 mapper.boxId2Box = bundle.BoxesList.Select((b, i) => new { Box = b, Index = i }).ToDictionary(k => (uint)k.Index + 1, v => v.Box);
Note: See TracChangeset
for help on using the changeset viewer.