Serialization, SelfServicing, recuding size...

Posts   
 
    
Liero
User
Posts: 40
Joined: 18-Sep-2009
# Posted on: 07-Sep-2010 15:55:28   

I serialize EntityCollection, but i would like to reduce size of the output xml.

      CustomerCollection cc = new CustomerCollection();
      cc.GetMulti(null, 3);

      string serialized;

      cc.WriteXml(XmlFormatAspect.Compact, out serialized);

The form of xml generated with XmlFormatAspect.Compact25 would be fine, but it is not supported in SelfServicing.

On the client i have the same LLBL project, but i don't need to instantiate the entities necessarily. Now I'm just copying field values to another enities. I dont need the IsChanged or IsNullabe informations to be serialized.

Thanks!

using v2.6, SelfServicing

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 07-Sep-2010 20:57:56   

You could project the entities onto simple lightweight POCO classes and serialize those - it should result in much smaller and simpler XML.

Matt

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39903
Joined: 17-Aug-2003
# Posted on: 08-Sep-2010 09:59:58   

Adapter is designed for this purpose, not selfservicing, as it makes no sense to have entities on the client which can do lazy loading and save themselves.

Frans Bouma | Lead developer LLBLGen Pro