Hi, I'm Ray

I'm a software developer, full-time nerd and occasional human (while heavily caffeinated).

Articles + Posts (Month: February 2019)

  • 23 Feb, 2019
  • C#: Serialise object to XML (three flavours)
  • I feel like at some point in every project you find yourself needing to serialise an object. My immediate go-to is JSON: whether it's being send to another system or saved to disk, the magicians at Newtonsoft have made it super-easy with JSON. However, when I had a requirement to use XML, the results looked somewhat messier than I expected. Here's what I discovered when serialising an object to XML, in three flavours.

Copyright © 2014-2019 Ray Lam. All Rights Reserved.