Lets say I build an Service Layer wich deals with POCOs coming out of an repository. The Repository is aware of the EF 4.0 and deals with POCO generation and so on. But that does also mean that my Repository will have a .NET 4.0 dependency and so my Service Layer which consumes the Repository will also have a .NET 4.0 dependency...even if its dealing only with POCOs and has no clue about the Entity Framework at all. Is there any way to work around this?
+1
A:
You could expose your EF entities using a WCF service - your server-side would be .NET 4 specific, obviously - with EF 4, .NET 4, WCF 4 - but the consumer / client doesn't have to be - if can be anything from any other .NET platform to PHP to Ruby to whatever might be calling your service.
marc_s
2010-07-03 13:00:32
Well, thats almost my scenario, except that I'm still working with Remoting instead of WCF. So maybe you could tell me if that works:1. the service contract assembly is .NET 3.5 and knows only about POCOs. Nothing EF specific.2. the service component deals with an Repository which knows about how to treat this POCOs and surely knows about the EF 4.0 and therefor will be .NET 4.0 bound.3. all the clients do only know about the contract assembly and the POCO assembly wich does not require .NET 4.0.Sounds good, will it work?
Christoph
2010-07-04 15:45:16
@Christoph: I don't know if mixing assemblies requiring different .NET frameworks in a single project will work - try it and report back!
marc_s
2010-07-04 18:55:24