I am getting error \"Cannot deserialize string from BsonType ObjectId\" while trying to get all the record from MongoDb in C# WebAPI
\"Cannot deserialize string from BsonType ObjectId\"
My Id is
Instead of using
ed.Id = Guid.NewGuid().ToString();
I used
ed.Id = MongoDB.Bson.ObjectId.GenerateNewId().ToString();
For generating Id
Its working fine : )