dynamic ConvertToDynamicThroughSerialization(object value) { var writer = new ByteBufferWriter(); var storedDescriptorCtx = _mapping.StoreNewDescriptors(writer, value); storedDescriptorCtx.FinishNewDescriptors(writer); storedDescriptorCtx.StoreObject(writer, value); storedDescriptorCtx.CommitNewDescriptors(); var originalDescription = _ts.DescriptorOf(value).Describe(); var reader = new ByteBufferReader(writer.Data); var ts = new TypeSerializers(); ts.SetTypeNameMapper(new ToDynamicMapper()); var mapping = ts.CreateMapping(); mapping.LoadTypeDescriptors(reader); var obj = (dynamic)mapping.LoadObject(reader); Assert.Equal(originalDescription, ts.DescriptorOf((object)obj).Describe()); return(obj); }
public IReadEventStore OpenReadOnlyStore(IEventFileStorage file) { return(new ReadOnlyEventStore(file, _typeSerializers.CreateMapping(), CompressionStrategy)); }