我正在开发一个简单的问答论坛。我想使用 Azure DocumentDB。
如何在 DocumentDB 中添加对现有问题文档的答案?
就我而言,我已经完成了与问题相同类型的答案列表:
public List<Announcement> { get; set; }
我的文档对象如下所示:
public class Announcement
{
[JsonProperty(PropertyName = "id")]
public string ID { get; set; }
[JsonProperty(PropertyName = "userid")]
public int UserID { get; set; }
[JsonProperty(PropertyName = "username")]
public string UserName { get; set; }
[JsonProperty(PropertyName = "useripaddress")]
public string UserIPAddress { get; set; }
[JsonProperty(PropertyName = "body")]
public string Body { get; set; }
[JsonProperty(PropertyName = "tags")]
public List<string> Tags { get; set; }
[JsonProperty(PropertyName = "datecreate")]
public DateTime DateCreate { get; set; }
[JsonProperty(PropertyName = "isedited")]
public bool IsEdited { get; set; }
[JsonProperty(PropertyName = "dateedit")]
public DateTime DateEdit { get; set; }
[JsonProperty(PropertyName = "imageaddonid")]
public string ImageAddonId { get; set; }
[JsonProperty(PropertyName = "imageaddonsource")]
public string ImageAddonSource { get; set; }
[JsonProperty(PropertyName = "answers")]
public List<Announcement> { get; set; }
}
我在 DocumentClient 中看不到任何更新方法:/。