// Example // var sample = new { booleanValue = true, stringValue = "Test Value" } // sample.Property("booleanValue") will result in true // sample.Property("stringValue") will result in "Test Value" static class ObjectExtensions { public static T Property(this object target, string name) { return (T)target.GetType().InvokeMember(name, BindingFlags.GetProperty, null, target, new object[] { }); } }