public void TestGetProperty() { var obj = new UserEntrity() { Age = 1, Name = "a", }; var fun = ReflectorUtil.Instance.GetPropertyValueFun(obj.GetType(), "Age"); for (int i = 0; i < Count; i++) { var value = fun.Invoke(obj); } }
public void TestGetProperty3() { var obj = new UserEntrity() { Age = 1, Name = "a", }; var type = obj.GetType(); var property = type.GetProperty("Age"); for (int i = 0; i < Count; i++) { var value = property.GetValue(obj, null); } }