dj-nitehawk / MongoDB.Entities

A data access library for MongoDB with an elegant api, LINQ support and built-in entity relationship management
https://mongodb-entities.com
MIT License
547 stars 70 forks source link

Missing Parameterless constructor #201

Closed gpsdevadmin closed 1 year ago

gpsdevadmin commented 1 year ago

In .NET deserializing an object with a property with MongoDB.Entities.Coordinates2D fails. There seems to be non-elegant ways to work around this but it would be awesome if you could add the following to the Coordinates2D class. This would allow these objects to be on the client-side and be sent to ASP.NET core seamlessly without creating DTOs or other mechanisms to work around this issue. If I'm missing something do let me know but I see not other easy way to make this happen.

Also please be kind this is my first issue submission in Github for any project so I don't know if this is the proper way to do this.

    public Coordinates2D() {
        this.Type = "Point";
        this.Coordinates = new double[2] { 0, 0 };
    }
dj-nitehawk commented 1 year ago

added in v21.0.2.6-beta changelog: https://github.com/dj-nitehawk/MongoDB.Entities/blob/master/changelog.md