c# - Can Expression.PropertyOrField be used to access a static property or field? -


the documentation of expression parameter of expression.propertyorfield states can null static members:

an expression type contains property or field named propertyorfieldname . this can null static members.
(emphasis mine)

however, whenever pass null argumentnullexception.

the documentation of method contradictory:

  • the documentation of expression parameter states can null static members
  • the documentation of argumentnullexception states thrown if expression null

fact is:
method can't used access static members, documentation of expression parameter incorrect.
when expression correct type supplied, method doesn't work expected, because ever looks instance members.

to access static field or property, use expression.makememberaccess instead.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -