LinqPad Dump from DLL
I would like to be able to call Dump from my DLL and code below returns raw HTML result. How can I render it, or what is the correct approach?
Method
Call
Result in LinqPad
P.S.: StackOverflow link http://goo.gl/D8Rwq
Method
public static string Dump<T>(this T obj)
{
var writer = LINQPad.Util.CreateXhtmlWriter();
writer.Write(obj);
return writer.ToString();
}
Call
Debug.WriteLine(myObject.Dump());
Result in LinqPad
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="Generator" content="LINQ to XML, baby!" />
<style type='text/css'>
...
</style>
</head>
<body>
<div>
...
</div>
</body>
</html>
P.S.: StackOverflow link http://goo.gl/D8Rwq
Comments
- added MYPROJECT's reference into LINQPAD and called MYFUNCTION in it.
- result comes to screen as HTML formatted raw string instead of rendered tables.
How can I force LinqPad to render that result?
Or else, call Console.WriteLine. LINQPad redirects Console.Out to the Dump function.