Created
November 10, 2017 09:14
-
-
Save abrari/c79991431a342dc7f2b967cc3459a3e9 to your computer and use it in GitHub Desktop.
LINQPad Object Dumper
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
using System.Diagnostics; | |
using System.IO; | |
namespace MyApp | |
{ | |
public static class Dumper | |
{ | |
public const string DumpFile = "dump.html"; | |
public static void Dump<T>(this T o) { | |
var localUrl = DumpFile; | |
using (var writer = LINQPad.Util.CreateXhtmlWriter(true, 1)) | |
{ | |
writer.Write(o); | |
File.AppendAllText(localUrl, writer.ToString()); | |
} | |
} | |
public static void Clear() | |
{ | |
File.WriteAllText(DumpFile, string.Empty); | |
} | |
public static void Show() | |
{ | |
Process.Start(DumpFile); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage example: