This is my 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;
}
}
And I get an error on the BsonElement
attribute:
I'm using:
Framework: .NET v4.5,
References: MongoDB.Driver.dll v2.0.1, MongoDB.BSON.dll v2.0.1
IDE: Visual Studio Premium 2012
Seems to work fine for the guy in this video.
Found it. This using
declaration was required:
using MongoDB.Bson.Serialization.Attributes;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With