I have written a Hello world app that nicely moved Entites around from client to server and back.
Is there anything special to setting up a WCF contract to accept a UnitofWork2 from a client?
My contract is:
[ServiceContract]
[ServiceKnownType(typeof(EntityCollection<CustomerEntity>))]
[ServiceKnownType(typeof(UnitOfWork2))]
public interface ICustomer
{
[OperationContract]
EntityCollection<CustomerEntity> GetCustomers();
[OperationContract]
void Update(UnitOfWork2 Unit);
}
When I pass in my UnitOfWork2 like this:
UnitOfWork2 unit = new UnitOfWork2();
unit.AddForSave(myCustomrEntity);
serverCustomer.Update(unit);
I get this error:
There was an error while trying to serialize parameter http://tempuri.org/:Unit. The InnerException message was 'Type 'System.Collections.Generic.List`1[[SD.LLBLGen.Pro.ORMSupportClasses.UnitOfWorkElement2, SD.LLBLGen.Pro.ORMSupportClasses.NET20, Version=2.5.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.
I do have **[ServiceKnownType(typeof(UnitOfWork2))] **in the contract.
Ideas?