更新时间:2023-09-15 21:45:40
XmlSerializer在成员 Name 的.DeclaringType上查找方法,而不在.ReflectedType上查找方法.这就是为什么它不起作用的原因.
Name
The XmlSerializer looks for the method on the .DeclaringType of your member Name, not on the .ReflectedType. This is why it doesn't work.
XmlSerializer ShouldSerialize *不适用于基本类型属性