1.将Component中的逻辑代码移动到Controller,这样可以reload这部分代码,实现方式是使用扩展方法,所以调用的方式可以不用改变.
2.本来想让Object支持集合初始化形式,例如 Object obj = new Object {{"a", 1}}.
这样需要继承IEnumerable,并且需要添加一个Add(string key, object value)方法,但是一旦实现IEnumerable接口,Mongdb会使用EnumerableSerializer序列化该类,导致异常.

google到如下说明:

https://jira.mongodb.org/browse/CSHARP-460

Here is a summary of the current situation:
1. Any class that subclasses a .NET collection class ends up being serialized using BsonClassMapSerializer, which doesn't work because the .NET collection class isn't designed the way BsonClassMapSerializer expects
2. As a result, the serialized document contains any public properties added by the derived class but does not contain the collection itself
Item 2 is particularly surprising to people...
The plan is to change the serialization of classes that implement collection interfaces to work better in more cases (but unfortunately not all). The new approach is essentially identical to that taken by the XmlSerializer in .NET.
The new approach will be:
1. Any class that implements IDictionary<TKey, TValue> will be serialized using DictionarySerializer<TKey, TValue>
2. Any class that implements IDictionary will be serialized using DictionarySerializer
2. Any class that implements IEnumerable<T> will be serialized using EnumerableSerializer<T>
3. Any class that implements IEnumerable will be serialized using EnumerableSerializer
Classes that implement IEnumerable<T> will also have to implement ICollection<T> if deserialization is desired (the Add method in ICollection<T> is needed for deserialization).
Classes that implement IEnumerable will also have to implement IList if deserialization is desired (the Add method in IList is needed for deserialization).
NOTE: just like with XmlSerializer, if your custom class implements either IEnumerable or IDictionary (legacy or generic) then ONLY the collection values will be serialized. If your custom class added additional public properties they will NOT be serialized.
This is the opposite behavior as before, but is wrong less often (not serializing the collection values is always wrong, but custom collections that don't have additional properties are now serialized correctly).
If you want to serialize your additional properties along with the collection values you will have to encapsulate and delegate to the collection class instead of subclassing it.
Alex's suggestion to add a KeyValuePairSerializer<TKey, TValue> is a good one also.
Work is in progress on this change.