How can I retrieve the instance of an attribute's associated object?

Posted by Brandon Linton on Stack Overflow See other posts from Stack Overflow or by Brandon Linton
Published on 2010-04-07T19:38:12Z Indexed on 2010/04/07 19:43 UTC
Read the original article Hit count: 242

Filed under:
|
|
|

I'm writing a PropertiesMustMatch validation attribute that can take a string property name as a parameter. I'd like it to find the corresponding property by name on that object and do a basic equality comparison. What's the best way to access this through reflection?

Also, I checked out the Validation application block in the Enterprise Library and decided its PropertyComparisonValidator was way too intense for what we need.

© Stack Overflow or respective owner

Related posts about c#

Related posts about reflection