skip to Main Content

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.

Can someone explain this or point me to a documentation?
Comparison of working and buggy versions

2

Answers


  1. Chosen as BEST ANSWER

    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 to kvInputs, and it worked.


  2. FieldName and his type should match to argument in ctor with the same name.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search