Skip to content

Instantly share code, notes, and snippets.

@gokulraja
Created May 21, 2014 13:22
Show Gist options
  • Save gokulraja/6184c23f582abf422fb0 to your computer and use it in GitHub Desktop.
Save gokulraja/6184c23f582abf422fb0 to your computer and use it in GitHub Desktop.
Linqpad Dump in Visual Studio
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