c# - Will PropertyInfo from Expression be equal to PropertyInfo from GetProperties() -
c# - Will PropertyInfo from Expression be equal to PropertyInfo from GetProperties() -
i know typeof(t) == typeof(t)
true because type
objects static , 1 type
instance exists per class type (if wrong, please right me...i have several programs function on assumption).
i having hard time finding in documentation whether or not propertyinfo
objects exhibit same property.
my application this:
i have reflector<t>
class takes result typeof(t).getproperties(...)
, stores resulting propertyinfo
objects keys in dictionary.
separately, have look parser attempts parse look describing access of property of type func<t, tresult>
(e.g. t => t.someproperty
t
beingness t.gettype()
, tresult
beingness type of someproperty
). after computation, propertyinfo
object coming memberexpression.member
passed expression
.
the resulting propertyinfo
used key in dictionary.trygetvalue
phone call additional info property stored in reflector<t>
's dictionary.
question
can assured propertyinfo
comes memberexpression.member
equal (==
) propertyinfo
same property returned type.getproperties
or there 2 different propertyinfo
instances in actuality refer same property on same type?
for purpose of discussion, may assumed property non-virtual or not overridden if virtual.
based on reference source code, should be. propertyinfo instance beingness obtained matching type.
c# reflection types lambda
Comments
Post a Comment