mongoDb反序列化类issue的属性
我正在尝试使用c#驱动程序从mongodb获取数据。我的数据库结构如下所示- 我的班级看起来像-mongoDb反序列化类issue的属性,mongodb,c#-4.0,Mongodb,C# 4.0,我正在尝试使用c#驱动程序从mongodb获取数据。我的数据库结构如下所示- 我的班级看起来像- public class Elementtab { public string Id { get; set; } public string title { get; set; } //new public string url { get; set; } // new public string owner { get; set; } //suaveid
public class Elementtab
{
public string Id { get; set; }
public string title { get; set; } //new
public string url { get; set; } // new
public string owner { get; set; } //suaveid
[BsonElement("date")]
public DateTime date { get; set; } //1
[BsonElement("captureStart")]
public DateTime captureStart { get; set; } //new
public Int32 checksum { get; set; } //new
public Boolean approved { get; set; } //new
public string comment { get; set; } //new
public Boolean hasContent { get; set; } //new
[BsonElement("clips")]
public List<valuecon> clips { get; set; }
}
public class valuecon
{
[BsonElement("html")]
public string html { get; set; } //new
[BsonElement("htmlTag")]
public string htmlTag { get; set; } //new
[BsonElement("src")]
public string src { get; set; } //new
[BsonElement("snapshot")]
public string snapshot { get; set; }
[BsonElement("range")]
public string range { get; set; }//new
[BsonElement("Type")] //new+old
public string Type { get; set; }
[BsonElement("id")] //subelementid+new
public string id { get; set; }
[BsonElement("size")]
public Int32 size { get; set; }
[BsonElement("box")]
public List<box> box { get; set; }
}
公共类元素选项卡
{
公共字符串Id{get;set;}
公共字符串标题{get;set;}//new
公共字符串url{get;set;}//new
公共字符串所有者{get;set;}//suaveid
[b单一元素(“日期”)]
公共日期时间日期{get;set;}//1
[b单一元素(“captureStart”)]
public DateTime captureStart{get;set;}//新建
公共Int32校验和{get;set;}//new
公共布尔批准{get;set;}//new
公共字符串注释{get;set;}//new
公共布尔hasContent{get;set;}//new
[b单一元素(“剪辑”)]
公共列表剪辑{get;set;}
}
公开课价值观
{
[b单一元素(“html”)]
公共字符串html{get;set;}//new
[BsonElement(“htmlTag”)]
公共字符串htmlTag{get;set;}//new
[BsonElement(“src”)]
公共字符串src{get;set;}//new
[b单一元素(“快照”)]
公共字符串快照{get;set;}
[b单一元素(“范围”)]
公共字符串范围{get;set;}//new
[bsonement(“Type”)]//新+旧
公共字符串类型{get;set;}
[BsonElement(“id”)]//子元素id+new
公共字符串id{get;set;}
[b单一元素(“大小”)]
公共Int32大小{get;set;}
[b单一元素(“框”)]
公共列表框{get;set;}
}
这给了我一个例外-
反序列化类newdata+Elementtab的clips属性时出错:元素名称应为“\u t”,而不是“3”。
请帮助我,告诉我为什么会发生这个错误,我哪里做错了 我会一次注释掉一个属性,直到您看到哪一个failsIt需要一个列表[Array]。你有子文件,我没给你。我应该在哪里使用list[Array]以及如何使用?