小编Ste*_*lak的帖子

Azure DocumentDB - 将对象插入文档数组?

我正在开发一个简单的问答论坛.我想使用Azure DocumentDB.

如何在DocumentDB中添加现有问题文档的答案?

在我的情况下,我已经完成了与问题相同类型的答案列表:

public List<Announcement>  { get; set; }
Run Code Online (Sandbox Code Playgroud)

我的文档对象如下所示:

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 …
Run Code Online (Sandbox Code Playgroud)

c# azure azure-cosmosdb

2
推荐指数
1
解决办法
2307
查看次数

标签 统计

azure ×1

azure-cosmosdb ×1

c# ×1