示例#1
0
        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);
            }
        }
示例#2
0
        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);
            }
        }