I am doing some serialization of db linq objects, which contain EntitySet and EntityRef classes.
I found a pretty easy way to deal with serialization of these classes, by simply using ISerializable to properly handle members of this type (converting them to lists for serialization, and undoing it on deserialization).
However, it would be really nice if I could do:
[Serializable]
[SerializeLinqEntities]
partial class Person
{ ... }
Instead of:
partial class Person : ISerializable
{
public virtual void GetObjectData( SerializationInfo si, StreamingContext ctxt )
{
EntitySerializer.Serialize(this, typeof(Person), si, ctxt);
}
protected Person( SerializationInfo si, StreamingContext ctxt )
{
EntitySerializer.Deerialize(this, typeof(Person), si, ctxt);
}
}
Is there a way to do this? I looked through the serialization classes and couldn't seem to find any way to setup custom serialization filter routines (where I could look for my custom attribute).
Thanks!