I found a workaround, but this week I had problems with FluorineFx , where I had a Linq-to -SQL-generated object that I wanted to send via cable to Flash. This object contained a property that Flash did not need:
[Association(Name="User_UserEntry", Storage="_UserEntries",
ThisKey="UserID", OtherKey="UserID")]
public EntitySet<UserEntry> UserEntries { ... }
But Flex was unable to handle the re-inclusion of this type by throwing:
ArgumentError: Error # 2173: Unable to read the object in the stream. The flex.messaging.io.ArrayCollection class does not implement flash.utils.IExternalizable, but is flattened by the outer class.
Now I did not need to send the property through the wire, so I tried the steps that Mark Gravell suggested in issue 456624 , first adding attributes to it using MetadataTypeAttribute in System.ComponentModel.DataAnnotations (found from JasonW issue 393687 :
[MetadataType(typeof(UserMetadata)]
public partial class User { }
internal class UserMetadata
{
[FluorineFx.Transient]
public EntitySet<UserEntry> UserEntries { get; set; }
}
Unfortunately, it appears that FluorineFx does not yet support metadata attributes (which is not surprising, tbh, they are completely new).
What I eventually had to do was create a dedicated DTO with all the properties that Flash cares about, and not one of the properties that it didn't. Not the most elegant solutions.
So, are there other people facing this problem and have you found more elegant ways to solve it?