Вы могли создать NHibernate IUserType
и определить его с помощью CustomTypeIs<T>()
на карте свойства.
obj.GetType().GetProperties()
does not return a PropertyDescriptorCollection
, it returns a System.Reflection.PropertyInfo[]
. The PropertyInfo
class does, as you suggest, represent only actual properties created on the object. A PropertyDescriptor
is either a custom concrete child of the PropertyDescriptor
class (implemented by the type defining the custom descriptor), or is an instance of the sealed internal class ReflectPropertyDescriptor
that uses the PropertyInfo
class to provide dynamic invocation of the property.
So for a class that does not define a custom descriptor, you will functionally get the same objects back, though the PropertyDescriptor
is abstracting away the PropertyInfo
.
Класс TypeDescriptor
используется в дизайнерах, чтобы они могли взаимодействовать со средой времени разработки. В частности, разработчики могут переопределять и расширять различные функции TypeDescriptor
, но не Type
.
Хорошим примером является работа с элементами управления с привязкой к данным. Свойство DataSource
относится к типу System.Object
, однако во время разработки это свойство заменяется новым свойством с более богатым пользовательским интерфейсом времени разработки.