tags:

views:

28

answers:

1

Hi,

All the tutorials that I see online when converting a database table to XML always involves a Data Context. However, I'm using Fluent Nhibernate mappings and therefore I don't want to do this.

Is there a way to say convert an IEnumerable to XML document instead? Or are there any other ways to get data from an Nhibernate mapped database to XML?

Thanks

+2  A: 

IEnumerable<> -> Xml

  1. Linq to XML - You can use this to build up XElements pretty easily from enumerables
  2. XmlSerializer - Will serialize POCO into XML, you can wrap something to make it serialize your IEnumerable easily
Aren
sweet. Thanks for that.
luminousSpark