Use System.Web.Script.Serialization.JavaScriptSerializer.Serialize, as in
private string GetJSON(object objectToSerialize)
{
JavaScriptSerializer serializer = new JavaScriptSerializer();
return serializer.Serialize(objectToSerialize);
}
On Thursday, November 22, 2012 11:23:43 PM UTC-5, MA wrote:
>
> Hi,
>
> I have several NHibenrate entities in my application which I am loading
> using lazy load. I need to pass those entity data to other application in
> Xml/Json format when request comes from that other application. So I have
> to serialize entity into Xml/Json format. Though I can navigate through
> entity's each property and prepare Xml/Json output but thought it would not
> be a good/efficient approach so just want to know if there is any
> ready-to-use feature/plug-in of NHibernate which can directly provide me
> Xml/Json output for given NHibernate entity.
>
> Thanks for your inputs.
>
> Regards.
>
>
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/nhusers/-/cMR-e0NqfP4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.