Hi,
I'm building a simple WCF service to consume a UnitOfWork2. The service successfully uses WCF to get and save single Entities, but it's giving me this error on transmitting a UnitOfWork2.
There was an error while trying to serialize parameter http://tempuri.org/:UOW. The InnerException message was 'Type 'System.Collections.Generic.List`1[[SD.LLBLGen.Pro.ORMSupportClasses.UnitOfWorkElement2, SD.LLBLGen.Pro.ORMSupportClasses.NET20, Version=2.6.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27]]' with data contract name 'ArrayOfUnitOfWorkElement2:http://schemas.datacontract.org/2004/07/SD.LLBLGen.Pro.ORMSupportClasses' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.'. Please see InnerException for more details.
Here's the contract:
[ServiceContract()]
[ServiceKnownType(typeof(EntityCollection))]
[ServiceKnownType(typeof(EntityCollection<CustomerEntity>))]
[ServiceKnownType(typeof(CustomerEntity))]
[ServiceKnownType(typeof(UnitOfWork2))]
public interface IPOCService
{
[OperationContract]
CustomerEntity GetCustomer(string ID);
[OperationContract]
CustomerEntity SaveCustomer(CustomerEntity Customer);
[OperationContract]
void SaveUnitOfWork(UnitOfWork2 UOW);
}
I use this WCF endpoint
<endpoint address="net.tcp://localhost:1234/POCService"
binding="netTcpBinding"
bindingConfiguration="ERMSBinding"
contract="ERMS.POC.Interfaces.WCF.IPOCService"
name="POCServiceNETTCP"/>