detecting native objects with reflection

后端 未结 2 1401
既然无缘
既然无缘 2021-01-06 06:01

I am working with a reflection based object translator.

it basically loops through properties of an object, and assigns the values to properties with the same name/

2条回答
  •  花落未央
    2021-01-06 06:24

    string is an exception, the only primitive type in .NET which is a reference type. You have to consider this exception in your code so that you check if IsClass is true and type is not the same as System.String.

提交回复
热议问题