'MongoDB.Bson.BsonElement' 不是简单 POCO 上的属性 class
'MongoDB.Bson.BsonElement' is not an attribute class on simple POCO
这是我的 POCO:
private class Widget
{
public int Id { get; set; }
[BsonElement("x")]
public int X { get; set; }
public override string ToString()
{
return "Id: " + Id + " X: " + X;
}
}
BsonElement
属性出现错误:
我正在使用:
框架:.NET v4.5,
参考文献:MongoDB.Driver.dllv2.0.1,MongoDB.BSON.dllv2.0.1
IDE:Visual Studio 高级版 2012
中的人似乎工作得很好
找到了。此 using
声明是必需的:
using MongoDB.Bson.Serialization.Attributes;
这是我的 POCO:
private class Widget
{
public int Id { get; set; }
[BsonElement("x")]
public int X { get; set; }
public override string ToString()
{
return "Id: " + Id + " X: " + X;
}
}
BsonElement
属性出现错误:
我正在使用:
框架:.NET v4.5,
参考文献:MongoDB.Driver.dllv2.0.1,MongoDB.BSON.dllv2.0.1
IDE:Visual Studio 高级版 2012
找到了。此 using
声明是必需的:
using MongoDB.Bson.Serialization.Attributes;