views:

57

answers:

1

Is this a design choice by Microsoft, or is there a way to do it, that I'm not aware of?

+2  A: 

If you want to use EF Entity Objects as of your entity types then you should have them implement a custom interface in a separate partial class since they are already inheriting from EntityObject.
However, if you use the new EF 4.0 POCO Entities, then you can freely have them inherit from ant custom base class that you want.
BTW, this has nothing to do with EF "design", it's just because you cannot have Multiple Inheritance in C#.

Morteza Manavi
Yup, POCO's FTW.
RPM1984
I will explore the POCO option. Also I understand that you can't use multiple bases classes, and I have been using interfaces to get things done. It's just that it would be nice if my custom base class could inherit from the EF base class (EntityObject), and I could add actual method implementations within my base class. It sounds like I can do that now with POCO. Thanks!
Dylan Vester
No problem. The other option would be to favor Composition over inheritance meaning that your entity objects will have a member of your custom base class. It's your call but I would still go with POCOs anyway.
Morteza Manavi
That's a thought, but I'm definitely going to check out POCO first. I appreciate your insight into this.
Dylan Vester
Question Answered
Dylan Vester