示例#1
0
        public DateTime MemberAccessWithFastMember_TypeAccessor()
        {
            var obj = new PropsOnClass {
                A = 123, B = "abc", C = DateTime.Now, D = null
            };
            var accessor = TypeAccessor.Create(typeof(PropsOnClass));

            return((DateTime)accessor[obj, "C"]);
        }
示例#2
0
        public DateTime MemberAccessWithFastMember_ObjectAccessor()
        {
            var obj = new PropsOnClass {
                A = 123, B = "abc", C = DateTime.Now, D = null
            };
            var accessor = ObjectAccessor.Create(obj);

            return((DateTime)accessor["C"]);
        }
示例#3
0
        public DateTime MemberAccessWithReflection()
        {
            var obj = new PropsOnClass {
                A = 123, B = "abc", C = DateTime.Now, D = null
            };

            return((DateTime)typeof(PropsOnClass).GetProperty("C")
                   .GetValue(obj));
        }