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
2010-10-20 21:01:55
Yup, POCO's FTW.
RPM1984
2010-10-20 22:47:08
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
2010-10-21 17:53:46
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
2010-10-21 18:00:28
That's a thought, but I'm definitely going to check out POCO first. I appreciate your insight into this.
Dylan Vester
2010-10-21 18:24:51
Question Answered
Dylan Vester
2010-10-21 18:25:12