MongoDB .NET Analyzer 1.3.0 Released

MongoDB .NET Analyzer 1.3.0 Release Notes

This is the general availability release for the 1.3.0 version of the analyzer.

The main new features in 1.3.0 include:

New analysis rules introduced: POCO to JSON

The new analysis rules allow to display the driver serialization result for a POCO in compiler time.
This can be used to validate correctness of BSON attributes setup and get a driver JSON representation shape.
For example:

public class Address
{
    [BsonElement("street")]
    public string StreetName { get; set; }

    [BsonIgnore]
    public string City { get; set; }
    
    public string Province { get; set; }

    [BsonElement("zip")]
    public string ZipCode { get; set; }
}

Will display the following JSON representation: { "street" : "Maplewood Lane", "Province" : "Lombardy", "zip" : "60601" }.
Notice that BsonElement and BsonIgnore attributes are accounted for.

Support for BSON serialization attributes

BSON serialization attributes like BsonElement, BsonIgnore, BsonIgnoreIfNull and other attributes are supported in POCO, LINQ and Builders analysis.

Additional main improvements in 1.3.0:

VS-93 introduces support for expressions with enums in tupples
VS-97 introduces better support for nullables

The full list of JIRA issues resolved in this release is available here.

1 Like

This topic was automatically closed after 90 days. New replies are no longer allowed.