linqpad - Is there a way to get an XML document instead of HTML from an entity dump? -


i love linqpad. there way xml document instead of html entity dump?

i wanted use linqpad.util create xml doc instead of html doc on linqtosql changeset. have tried many ways serialize changeset unsuccessfully. linqpad util createxhtmlwriter works great prefer xml document. ideas on how quickly?

right there's nothing in linqpad dump arbitrary object graph xml. however, should able describe quite extension method. go my extensions in linqpad , write method this:

public static xelement toxml (this changeset cs) {     return new xelement ("changeset",         new xelement ("inserts", cs.inserts.select (e => entitytoxelement (e))),         new xelement ("updates", cs.updates.select (e => entitytoxelement (e))),         new xelement ("deletes", cs.deletes.select (e => entitytoxelement (e)))); }  static xelement entitytoxelement (object o) {     return new xelement (         o.gettype().name,         o.gettype().getfields ().select (f => new xelement (f.name, f.getvalue (o)))); } 

then, in query, can go:

getchangeset().toxml().dump(); 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -