views:

156

answers:

1

I have generated an EDMX project, and I have my data entity classes set up. They all inherit from System.Data.Object.DataClasses.EntityObject. What I would like to do is have another abstract class that inherits from EntityObject, and then my data entity classes inherit from that new class.

What is the best way to accomplish this?

Thank you for any help.

+2  A: 

You are right in thinking about removing EntityObject, artifacts of EF classes should not get exposed over the wire.

Please, please, please use the DTO pattern for objects that get passed over the wire.

If you create new DTO classes (manually or using a T4 template) and use something like AutoMapper to map the data back and forth.

The serialized payloads will be far simpler and more reusable.

JTew
I see; passing an abstract class would only be able to pass the parameters defined in that class, and would not have the rest of the data. Thanks.
Sako73
Correct as well.
JTew