I am trying to fetch a record from the mongo db in c#
Data in the mongodb collection:
{
id:0
parameter:"Unscheduled Demand"
remarks:"Formula Based"
value:89
}
Issue: id
property is not getting deserialized from the data in C#.
C# class structure:
public class children
{
[BsonId]
[BsonRepresentation(BsonType.Int32)]
public int id { get; set; }
public string parameter { get; set; }
public string remarks { get; set; }
public double value { get; set; }
}
This is the error that occurs:
Element 'id' does not match any field or property of class children