public class Foo { public string Bar {get; set;} }
How do I get the value of Bar, a string property, via reflection? The following code will thr
Foo f = new Foo(); f.Bar = "x"; string value = (string)f.GetType().GetProperty("Bar").GetValue(f, null);