Reflection class to get all properties of any object

后端 未结 3 2034
眼角桃花
眼角桃花 2020-12-31 20:14

I need to make a function that get all the properies of an object (including an children objects) This is for my error logging feature. Right now my code always returns 0 pr

3条回答
  •  春和景丽
    2020-12-31 21:06

    The problem with your code is the PayPal Response types are members, NOT properties. Try:

    MemberInfo[] memberInfos = 
        thisObject.GetMembers(BindingFlags.Public|BindingFlags.Static|BindingFlags.Instance);
    

提交回复
热议问题