0 vote down star 1
I want to be able to share my datacontracts (classes generated in the linq to entities designer are decorated with the [DataContract] attribute.
I'm trying to use the architecture as detailed here: http://www.netfxharmonics.com/2008/11/Understanding-WCF-Services-in-Silverlight-2 and trying to reference my interfaces in my silverlight project using the 'Add as link' method as detailed here: http://www.netfxharmonics.com/2008/12/Reusing-NET-Assemblies-in-Silverlight
The problem I'm having is referencing my service interface in my silverlight project.
My solution has the following projects:
ORM - contains a Linq to Entities edmx model (namespace: company.client.Service) - the classes in this are decorated with DataContract attribute etc.
ServiceInterface - contains the interfaces (namespace company.client.Service) and a reference to the ORM for the classes (Customer etc) being returned
Service - contains the implementation of the service interfaces (namespace company.client.Service) and references ServiceInterface and the ORM for the classes.
ServiceHost - contains just .svc files as recommended in http://www.netfxharmonics.com/2008/11/Understanding-WCF-Services-in-Silverlight-2
WebSLHost - the host for the silverlight app
Gui - the silverlight GUI.
I want all the of the projects to be standard .net assemblies except for the silverlight gui of course.
When I try to add a link to my service interface files (as shown in http://www.netfxharmonics.com/2008/12/Reusing-NET-Assemblies-in-Silverlight) it give a compile error stating that it can't find the ORM and can't identify my entity types.
I want to be able to share the datacontract generated by the linq to entities generator with my service and the silverlight client, so if anyone has any ideas I'd appreciate them.