0

At the moment we have EF v4.3 running. The servers themselves have .net framework 4.0 installed as do the client machines.

The layers of application are split into different solution files so we can aim them at different .net frameworks

The client version of the application is set to run on .net framework 4.0

We wish to upgrade Entity Framework to version 6. As we have control over our servers we can upgrade the .net framework on them easily enough, what we can't do is upgrade the .net framework on the client PC's from 4.0

Can I have a client built for .net 4.0 but communicating via WCF to Entity Framework 6? If so what limitations do I need to be aware of?

Wobble
  • 89
  • 1
  • 10
  • EF6 can be used with .NET 4.0. – Steve Mar 20 '14 at 15:33
  • possible duplicate of [Does Entity Framework 6 support .NET 4.0?](http://stackoverflow.com/questions/19239140/does-entity-framework-6-support-net-4-0) – Steve Mar 20 '14 at 15:33
  • If you use EF6 in the same project that is aimed at .net 4.0 then you only get the features of EF that are available in EF4.3 - I want to know if using different projects across WCF can I utilise the new features of EF6 on the server side with .Net 4.0 on the client – Wobble Mar 21 '14 at 09:13

1 Answers1

1

Shouldn't be any issue having a client communicate via WCF to a server that uses EF6. If you're using POCO classes for your models at least - that way you don't need a reference to EF in your client.

I usually enforce a separation between my data model classes and the view classes I transmit to/receive from clients, so when you pull an entity from the database in your server, manually create a view class and pass that over wcf rather than your model directly, this way the models can change without having any effect on your published interface, and the clients don't get any access to fields they shouldn't (ID fields and so on).

also means that:

  1. your datacontracts can be more tailored to the exact intent of the methods you are providing
  2. you don't have to worry about detaching / reattaching the instances that you send/receive to your data context
plmeister
  • 196
  • 2
  • We are using POCO's so that is looking good for upgrading to EF6. Interesting idea regarding passing the View Class over WCF - I'll have to look into that in more detail to get a better understanding – Wobble Mar 21 '14 at 09:04