New Posts New Posts RSS Feed: Defining Base Type for each Entity
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Defining Base Type for each Entity

 Post Reply Post Reply
Author
midnit View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22-Jun-2009
Location: Charlotte
Posts: 112
Post Options Post Options   Quote midnit Quote  Post ReplyReply Direct Link To This Post Topic: Defining Base Type for each Entity
    Posted: 23-Jul-2010 at 12:42pm

So in our continued effort to upgrade to 2010...we have different base types for certain entities but I have yet to see a way to accomplish the same thing with the 2010 version.

Perviously the XML attribute ib:AdornedBaseTypeName="BasePricingEntity -> Entity" let use do this. Is there no way to accomplish the same thing now?
Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Posted: 23-Jul-2010 at 2:47pm
In DevForce 2010, you can only have a single injected base class.  If you don't know already, you set this using the "Injected Base Type" field on the property sheeet for the edmx.
Back to Top
midnit View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22-Jun-2009
Location: Charlotte
Posts: 112
Post Options Post Options   Quote midnit Quote  Post ReplyReply Direct Link To This Post Posted: 26-Jul-2010 at 5:32am
Yes, but as I said I need more the one.
 
So...what ARE the options? Is it possible to change the t4 template such to read a userdefined xml attribute in the model to override the base type? No hidden attributes for the users control their own destiny?
 
When will the product include the feature to define our own base types per entity?
Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Posted: 26-Jul-2010 at 8:28pm
Sorry, I didn't have time earlier to elaborate.
 
This is actually a restriction of the Entity Framework.  This worked in DevForce 2009 because we had full control over the object hierarchy.  In DevForce 2010, the Entity Framework creates the DevForce objects directly (which results in better performance among other things), but we have to live with this constraint.
 
An alternative implementation is to define extension methods on interfaces and the mark the entities with the desired interface.  This gives the same API feeling for the business object consumers, and the underlying implementation can still be quite clean.
 
For those unfamiliar with extension methods, here's the MSDN link:
 


Edited by ting - 26-Jul-2010 at 8:28pm
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down