I have a TextSearchJob
object to store on MongoDB.
I am rather new with the database and I don’t know why I have this error with the IDictionary
version (on the right) while I have no error with the IEnumerable
version(on the left):
MongoDB.Bson.BsonSerializationException: Creator map for class TextSearchJob has 2 arguments, but none are configured.
2
Answers
It appears that if the constructor parameter name matches the property name, it must be of the same type.
For my constructor, I wanted to have a type different from the property. So to solve my problem, I had to give a parameter name different from the property's to be able to use a different type... Go figure. :/
So, I just renamed my parameter
inputs
tokvInputs
, and it worked.FieldName and his type should match to argument in ctor with the same name.