XElement in business object won't save - not seriallizable...

XElement in business object won't save - not seriallizable...

Old forum URL: forums.lhotka.net/forums/t/6212.aspx


tdrake posted on Tuesday, January 20, 2009

public System.Xml.Linq.XElement Message

{

get

{

return GetProperty<System.Xml.Linq.XElement>(_Message);

}

set

{

SetProperty<System.Xml.Linq.XElement>(_Message, value);

}

}

and all the usual plumbing to save the data to a XML field in SQL, but getting a 'XElement' not serializable when I call Save in the PO.

Is there any way I can work with XML data in a BO.

Thanks Tony

 

 

tdrake replied on Tuesday, January 20, 2009

see post from MS...

http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=346283

tdrake replied on Tuesday, January 20, 2009

mmm strings.

So now I move the XML to BO string property in the DTO and back:

DTOPublishRequest.Message = XElement.Parse( GetProperty<string>( _Message));

and have a readonly XElement property in the BO which does the same. Ugly.

Anyone else got a better idea? I'm using Linq->XML to work with this, so I had like to leave the XML alone (although I'm not sure what the overhead of a large XML string).

Tony

 

 

Copyright (c) Marimer LLC