I'm using RavenDb. I'm storing different objects, but these objects have the same name.

Namespace.Models.X

abstract class A

class B : A
class C : A


Namespace.Models.Y

abstract class D

class B : D
class C : D

Raven is storing both types in the format:

Namespace.Models.X.B as type/1 
Namespace.Models.Y.B as type/2

Is there a way to override the collection name associated with the document? I could change my class names but I'd rather not if possible.

有帮助吗?

解决方案

Yes, using:

documentStore.Conventions.FindTypeTagName = type => /* get type name as you wish it */;
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top