4

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:

enter image description here

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.

SNag
  • 17,681
  • 10
  • 54
  • 69

1 Answers1

8

Found it. This using declaration was required:

using MongoDB.Bson.Serialization.Attributes;

SNag
  • 17,681
  • 10
  • 54
  • 69