|
by gavin via elephantsintheroom.org on 1/19/2008 1:40:03 AM
The Evil method (+ 1 overload and a MemberInfo extension), below, allows traversal of an object graph by string. It works on properties, fields and methods that take no parameters or indexers. usage: string s = person.Evil("Home.Postcode.ToString"); static class ObjectExtension
{
public static object Evil(this object target
, string s)
{
return target.Evil(s, '.', '\\', '/', ',');
}
public static object Evil(this object target
... [ read more ]
|
|