What is the .NET equivalent of PHP var_dump?

后端 未结 5 1012
春和景丽
春和景丽 2020-12-31 07:43

I remember seeing a while ago that there is some method in maybe the Reflection namespace that would recursively run ToString() on all of an object\'s propertie

5条回答
  •  我在风中等你
    2020-12-31 08:18

    I think what you're looking for is/was called ObjectDumper. It uses reflection to iterate through and output all of the different properties for an object. I first heard about it while learning LINQ, and most of the examples in the Linq in Action book use it.

    It appears that Microsoft didn't include it in the final version of Linq though, but the code is still out in the wild. I did a quick google search for it and here's a link to it:

    ObjectDumper Source Code

提交回复
热议问题