Created
May 21, 2014 13:22
-
-
Save gokulraja/6184c23f582abf422fb0 to your computer and use it in GitHub Desktop.
Linqpad Dump in Visual Studio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class MyExtensions | |
{ | |
static bool openBrowser = true; | |
public static string Dump<T>(this T o, string title) | |
{ | |
using (var writer = LINQPad.Util.CreateXhtmlWriter(true)) | |
{ | |
writer.Write(o); | |
if (openBrowser) | |
{ | |
string localUrl = Path.GetTempFileName()+"_"+ title + "_.html"; | |
File.WriteAllText(localUrl, writer.ToString()); | |
System.Diagnostics.Process.Start(localUrl); | |
} | |
else | |
{ | |
return writer.ToString(); | |
} | |
} | |
return string.Empty; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment