Type Microsoft.OData.Edm.EdmModel is not configured as a type that is allowed to be serialized for this instance of ObjectSerializer
Version: 8.0.12 MongoDB.Driver: 2.19.2 MongoDB.Entities: 22.0.0
I am using MongoDB to create Odata service.
Here are my API and entity object
The issue currently while using https://localhost:7119/odata/Supplier?select=Name select for mongo db collection. It is throwing an error for mongo db. I am not sure is a mongo db package issue or if something needs to configure for OData. BsonSerializationException: Type Microsoft.OData.Edm.EdmModel is not configured as a type that is allowed to be serialized for this instance of ObjectSerializer.
Can anyone guide here on what can be an issue here?
Do you get the correct results when you don't apply a $select query option?
i.e GET https://localhost:7119/odata/Supplier
Yes @KenitoInc
https://stackoverflow.com/a/75637412/234440
https://stackoverflow.com/a/75637412/234440
Are you posting this as a potential solution to the problem @okutbay ? Can you provide some context to go along with your link comment?
Hi @julealgon, yes that link has the solution to this problem. So mongodb driver added a configuration requirement to Serialize objects. You need to define explicitly which objects can be serialized. Otherwise you keep getting this error.