我在尝试NEventStore。我启动了示例项目,创建了一些事件并保存到数据库中。但在数据库中,我只看到加密的数据,无法识别存储事件的正确性。我试着关闭所有关于加密的设置,但是没有什么改变。
我的密码:
var init = Wireup.Init()
.LogToOutputWindow()
.UsingInMemoryPersistence()
.UsingSqlPersistence("EventStore") // Connection string is in app.config
.WithDialect(new MsSqlDialect())
.EnlistInAmbientTransaction() // two-phase commit
.InitializeStorageEngine()
.TrackPerformanceInstance("example")
.UsingJsonSerialization()
//.Compress()
//.EncryptWith(EncryptionKey)
.HookIntoPipelineUsing(new[] {new AuthorizationPipelineHook()})
.UsingSynchronousDispatchScheduler()
.DispatchTo(new DelegateMessageDispatcher(DispatchCommit))
.Build();我试图在SQL中通过cast([Payload] as varchar(max)将varbinary转换为varchar,但也没有收到干净的数据。
请问我如何以可读的形式读取NEventStore数据?
发布于 2015-12-23 15:14:26
可以将Payload列转换为XML:
SELECT TOP 10 CAST(Payload AS XML), *
FROM [dbo].[Commits]尽管有效载荷实际上是JSON,但我得到了正确的结果。
[{"Headers":{},"Body":"Test"}]显然,这不适用于压缩或加密的数据。
https://stackoverflow.com/questions/31511681
复制相似问题