我已经从这里http://ravenmvc.codeplex.com/releases/view/45994下载了示例mvc应用程序。
它工作得很好。但我有个问题。在示例应用程序中,DocumentId看起来像"categories-2",但在我的应用程序中,在我调用Store method之后:
using (var session = DocumentStore.OpenSession())
{
session.Store(item);
session.SaveChanges();
return item;
}我有像“DocumentId /3073”这样的项目。我希望DocumentId的格式与示例应用程序中的格式一样。我怎么能做到这一点?有什么我应该改变的选项吗?
发布于 2010-12-12 21:18:22
您需要在初始化DocumentStore时设置DocumentConvention:
var ds = new DocumentStore();
ds.ConnectionStringName = connectionStringName;
ds.Initialize();
ds.Conventions.IdentityPartsSeparator = "-";https://stackoverflow.com/questions/4421765
复制相似问题