A wield mongodb serialization issue caused by hidden property

  • fennng 
This line throw exception.
Here is the exception detail

The problem is caused by 

The reason to use the new keyword is to hide the Name property in the base calss which has a required attribute. The new keyword will override the require attribute so that Name will not be validated.
The name in base class is hidden, but when mongo does serialization, it will found two names, so it causes the problem. The error message is confusing anyway. It's nothing to do with Id.


您的电子邮箱地址不会被公开。 必填项已用*标注