System.FormatException : Element ‘Count’ does not match any field or property of class M220N.Models.Projections.ReportProjection.
Any one getting this same exception?
System.FormatException : Element ‘Count’ does not match any field or property of class M220N.Models.Projections.ReportProjection.
Any one getting this same exception?
Yeah, still not resolved yet.
Oh, this is actually not for Chapter 3 but for the first ticket of Chapter 4, If possible, please update the topic for me, change “Chapter 3” to “Chapter 4”
The eventual solution for this issue is actually adding BsonElement to the Count property of ReportProjection class, a change I suspected since the very beginning.
public class ReportProjection
{
[BsonElement("_id")]
public string Id { get; set; }
[BsonElement("Count")]
public int Count { get; set; }
}
@kanikasingla , if possible, please add a video with detailed explanation of the serialization of C# classes, what could be the difference with and without these attributes, thanks.
P.S. I suspect ‘Count’ could also be a special property name which caused all those trouble.
Thank you so much - this had me stumped. Come on MongoDB, get the framework code for mflix sorted!
You are welcome, Mark, I am glad my post helped other students here.