RavenDB Id和x27上的特殊配置;s
我想在RavenDB的Id上修改两个小东西,因此我执行以下代码:RavenDB Id和x27上的特殊配置;s,ravendb,Ravendb,我想在RavenDB的Id上修改两个小东西,因此我执行以下代码: documentStore.Conventions.FindIdentityProperty = (prop) => prop.Name == "ID"; documentStore.Conventions.DocumentKeyGenerator = (entity) => entity.GetType().FullName + "/"; 但是这些代码行只有在另一行未启用的情况下才能工作,我无法让它们一起工作 这可
documentStore.Conventions.FindIdentityProperty = (prop) => prop.Name == "ID";
documentStore.Conventions.DocumentKeyGenerator = (entity) => entity.GetType().FullName + "/";
但是这些代码行只有在另一行未启用的情况下才能工作,我无法让它们一起工作
这可能吗
谢谢 我完全按照您提供的方式测试了您的代码,它在Ravendb1.0.992中运行。我认为您使用的是旧版本 实际上,您应该自定义
FindTypeTagName
约定,而不是DocumentKeyGenerator
documentStore.Conventions.FindIdentityProperty=prop=>prop.Name==“ID”;
documentStore.Conventions.FindTypeTagName=type=>type.FullName;
很有趣,但在我当前的版本中,这一点很有效。谢谢!