Is UnitOfWork2 supposed to be serializable for use with WCF? Based on comments in old threads, it was planned to be implemented for version 3 but I can't find anything in the docs that addresses UnitOfWork specifically.
When I try to send a UnitOfWork2 (with version 3.1), I get deserialization errors for the various lists contained within the uow. For example:
System.ServiceModel.FaultException : The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter uow. The InnerException message was 'Error in line 1 position 30173. Element ':_deleteEntitiesDirectlyCalls' contains data from a type that maps to the name 'System.Collections.Generic:List`1'. The deserializer has no knowledge of any type that maps to this name. Consider changing the implementation of the ResolveName method on your DataContractResolver to return a non-null value for name 'List`1' and namespace 'System.Collections.Generic'.'. Please see InnerException for more details.
I can add all of these lists as ServiceKnownTypes, except that three of the classes for which there are lists are internal. That is, I can add
[ServiceKnownType(typeof(System.Collections.Generic.List<SD.LLBLGen.Pro.ORMSupportClasses.UnitOfWorkBlockType>))]
but not
[ServiceKnownType(typeof(System.Collections.Generic.List<SD.LLBLGen.Pro.ORMSupportClasses.UnitOfWorkCallBackElement2>))]
With some extra work I can add them through reflection, but before I do that I'm wondering if I'm missing something obvious, or if this is even meant to work. Should I be looking at a different approach than sending a UnitOfWork?