问题描述
LINQPad令人惊奇,尤其有用的是Dump()
扩展方法,该方法将几乎任何类型的对象和结构(无论是否匿名)呈现到控制台.
LINQPad is amazing, and particularly useful is the Dump()
extension methods which renders objects and structs of almost any type, anonymous or not, to the console.
最初,当我移到Visual Studio 2010时,我尝试使用委托创建自己的Dump
方法,以获取要为匿名类型等渲染的值.首先,我需要一个可靠的实现.在 .NET Reflector 中签出LINQPad代码后,我什至可以确信我不会将正确实施.
Initially, when I moved to Visual Studio 2010, I tried to make my own Dump
method using a delegate to get the values to render for anonymous types, etc. It's getting pretty complicated though and while it was fun and educational at first, I need a solid implementation. Having checked out the LINQPad code in .NET Reflector I am even more assured that I'm not going to get the implementation right.
我可以包括一个免费库来提供Dump
功能吗?
Is there a free library I can include to provide the Dump
functionality?
推荐答案
看这里(您的路径可能有所不同):
Look here (your path may vary):
C:\ Program Files(x86)\ Microsoft Visual Studio 10.0 \ Samples \ 1033 \ CSharpSamples.zip \ LinqSamples \ ObjectDumper
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Samples\1033\CSharpSamples.zip\LinqSamples\ObjectDumper
这篇关于如何在Visual Studio中使用LINQPad Dump()扩展方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!