MongoDB: Is it possible to set the case of a BsonElement by default?

Viewed 3585

I am using the Mongodb official driver and I want to set by default the naming of the elements to lower case to avoid code like this:

public class Localization
{
    [BsonId(IdGenerator = typeof(ObjectIdGenerator))]
    public int Id { get; set; }
    [BsonRequired]
    [BsonElement("country")]
    public string Country { get; set; }

In this sample I want that by default the element name be "country" not "Country" aka lower case. Is it possible?

Thanks

3 Answers
Related