What is the proper way to ensure a custom property gets serialized?
We have added a custom property to enable/disable some custom pre-save logic during the save of the entity on the server (using .NET Remoting between client/server).
[Browsable(false)]
[DefaultValue(false)]
pubilc bool DisableCustomSaveLogic {get; set;}
(this allows us to bypass some extensive custom business logic when doing imports from external systems)
It seems that when we pass a single entity across the remoting wire, the property is correctly serialized/deserialized. However, when passing it as part of a EntityCollection<T> or UnitOfWork the property always has the default value when it is deserialized. In other words, it is not be serialized/deserialized in this case.
We are using SerializationOptimization.Fast
I've tried various approaches using the OnGetObjectData/OnDeserialized. Also I have tried using CustomXmlSerializationAttribute and overriding PerformCustomXmlDeserialization/PerformCustomXmlSerialization, with no success so far... although I couldn't find a good example of this, so perhaps I didn't do it correctly.
Can you tell me the proper way to make sure this property gets serialized correctly in both scenarios (simply passing the entity across, as well as part of a collection/uow)?
LLBLGen 2.6, Adapter (with manager templates), .NET 4.0, SQL Server 2005+