my C# class
public class User
{
[BsonRepresentation(BsonType.ObjectId)]
[Newtonsoft.Json.JsonProperty(PropertyName = "_id")]
public string? Id { get; set; }
[Newtonsoft.Json.JsonProperty(PropertyName = "name")]
public string Name { get; set; }
[Newtonsoft.Json.JsonProperty(PropertyName = "email")]
public string Email { get; set; }
}
my mongodb json document
{ "_id": { "$oid": "63353few87yr8748wd8" }, "Name": "Rishabh", "Email": "Rishabh@gmail.com" }
expected json
*****{ "_id": { "$oid": "634376t7tegr78145d8" }, "name": "Rishabh", "email": "Rishabh.soni2@honeywell.com"
}*****
I want the property in small case is there any solution for it I have already tried with changing the class property by Name to name it worked but I don't want that way I just need to save the key name in small letter not the class property name. Please suggest any solution for it.