Custom Member serialization / deserialization in LLBLGen 2.5

Posts   
 
    
mickar
User
Posts: 20
Joined: 13-Jul-2006
# Posted on: 08-Nov-2007 15:37:44   

Hi,

i am using LLBLGen 2.5 and have a question about adding own member variables to an entity class. This class must be send over to webservice and the member must also be transferred, because it is used at the webservice.

In the documentation i see that i have to use a CustomXmlSerializationAttribute on the member and then override the members PerformCustomXmlSerialization and PerformCustomXmlDeserialization.

Now i have a custom member variabele of the type EntityCollection. Is there an example how to implement the PerformCustomXmlSerialization and PerformCustomXmlDeserialization methods?

Thanks for answering this question!

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 09-Nov-2007 15:24:50   

Is there an example how to implement the PerformCustomXmlSerialization and PerformCustomXmlDeserialization methods?

I couldn't find examples for overriding these methods.

But I think it's pretty simple, please refer to the LLBLGen Pro Reference manual, for discription of overriding these methods.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 11-Nov-2007 11:19:17   

In the method you simply have to write XML, and in the deserialization variant you've to read the XML: the reader is at the element, so just read the xml and be done with it. As it's an EntityCollection, simply call WriteXml and ReadXml on the collection, by passing the reader.

Frans Bouma | Lead developer LLBLGen Pro