开发者

RavenDb - Cannot Store Due to Duplicate Property Name

开发者 https://www.devze.com 2023-04-11 12:56 出处:网络
I\'m trying to store a document in Raven - but a subclass hides a property on a base class - same name but different type. When I try and save it, I get this error:

I'm trying to store a document in Raven - but a subclass hides a property on a base class - same name but different type. When I try and save it, I get this error:

"A member with the开发者_开发知识库 name 'User' already exists on 'Account'. Use the JsonPropertyAttribute to specify another name

However, the class is sealed and I don't own it or cannot extend it. Do I have any options at all?


If you can modify the class that you are trying to store, you can set the JsonContract (on the DocumentConventions) and modify how it gets serialized from there.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号