Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Issues with TLists

Hi,

I have a class called TPerson that has an Alias Attribute of 'Person'. This works great when serializing one instance of Person. But once I put that person into a generic TList<TPerson> the following issues occur.

1) I get this error: Project MyProject.exe raised exception class ESerialize with message 'AliasAttribute cannot be used in TPerson'.

If I remove the alias then when I try and serialize the TList I get the following error.

2) Project MyProject.exe raised exception class ESerialize with message 'Cannot serialize values of type TCollectionNotifyEvent<uPersonSerializable.TPerson>'. 

It would seem that NGSerializer does not recognize Lists of classes as a valid serialize object. How do I use your product to process lists? And what if one of the properties in my object is a list of child classes?

Please help this is a very important feature for us.

Thanks,

Todd Flora
Retail Pro.

Comments

  • 3 Comments sorted by Votes Date Added
  • One more thing. Even if I use an array of TPerson as an attribute I still get the #1 errror above. What does this error mean. There instances when I want to serialize a TPerson by itself and I need this alias attribute, why does it complain about the attribute when I then use TPerson in an array?

    Thanks,

    Todd Flora
  • Hi,

    #1 - this is strange, I'll look at.

    #2 - right, serializer does not treat TList (or any other collection) specially; they are treated just as classes, and so, serializer try to write all collection object's properties. For now you need a custom converter in this case.
Sign In or Register to comment.