tags:

views:

163

answers:

1

Hi

We are using Linq to Entities in WCF service. We created a edmx file which contains auto generated entities. While creating proxy the entities are not appearing in the proxy class even the data contract and datamember attributes are there. We found that the problem is because of the auto generated entities are inheriting from something called System.Data.Objects.DataClasses.EntityObject But if we create a class without any inheritance that class is appearing in the proxy. Is there any way to resolve this?

Regards Sekar

+1  A: 

The way we do this is:

  • Auto generate entity framework entities
  • Create separate classes to be used in the data contracts
  • Write mapping code to convert from one contract classes to entity classes, and back

This may be a bit cumbersom but it works (it also isolates your services from changes in your database). This should become much easier in the next version of entity framework.

Shiraz Bhaiji