使用 CosmosDB 的 C# 模型如何处理模型更改

C# models with CosmosDB how to handle model changes

我一直在使用 MongoDB 到 Azure CosmosDB (DocumentDB) 的协议编写一个系统,并编写代码以对模型进行更改并防止崩溃。我们正在考虑切换到 CosmosDB 协议,但一直无法找到执行此操作的方法。有谁知道这是否可能以及正确的方法是什么? MongoDB 是 属性 像:

[BsonExtraElements]
public IDictionary<string, object> ExtraElements { get; set; }

我们只关心 属性 删除和 renaming/retyping(即从 string Code {get; set;}SomeAwesomeObject Code {get; set;}

感谢@wasabi,我能够确定 JsonExtensionDataAttribute 是这项工作所需要的。 http://www.jerriepelser.com/blog/using-jsonextensiondata-with-jsonnet/

对此有很好的解释