Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
此问题仅与 RavenDb 的第 4 版有关。在以前的版本中,我们可以选择为集合生成身份密钥,即。
_documentStore.DatabaseCommands.NextIdentityFor(collectionName);
我如何在 RavenDb 4 中做同样的事情?
在 RavenDB 4.0 中,现在这样完成:
using (var shortTermSingleUse = JsonOperationContext.ShortTermSingleUse()) { var command = new NextIdentityForCommand("users"); await store.GetRequestExecutor().ExecuteAsync(command, shortTermSingleUse); }