New Posts New Posts RSS Feed: Injected Base Type Example
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Injected Base Type Example

 Post Reply Post Reply
Author
jmarbutt View Drop Down
DevForce MVP
DevForce MVP


Joined: 04-Jun-2010
Posts: 17
Post Options Post Options   Quote jmarbutt Quote  Post ReplyReply Direct Link To This Post Topic: Injected Base Type Example
    Posted: 11-Jun-2010 at 8:43am
Is there an example of Injected Base Type in the learning resources? I can't seem to find it.
Back to Top
GregD View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 374
Post Options Post Options   Quote GregD Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jun-2010 at 1:58pm
No, I don't think there's anything any there yet.

Be aware that DevForce doesn't generate the developer class file for an injected base type, so you need to create one in order to do anything with the base type.

You can use another generated developer class file (or the code below) as a model, but be sure your base type inherits from IdeaBlade.EntityModel.Entity.


using System;
using System.Linq;
using IbEm   = IdeaBlade.EntityModel;
using IdeaBlade.Core;

namespace SilverlightConsole {
public class BaseEntity: IbEm.Entity {
}
}

Back to Top
jmarbutt View Drop Down
DevForce MVP
DevForce MVP


Joined: 04-Jun-2010
Posts: 17
Post Options Post Options   Quote jmarbutt Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jun-2010 at 2:05pm
So how does this get applied to the actual database? I guess I don't have a good understanding of the Injected Base Type.

We basically have a base entity in our database that has:
CoreEntity
- ID
- CreatedDate
- CreatedBy
- UpdateDate
- UpdatedBy

I would like all our tables to have a row in our CoreEntity table. So if we have a Person row with an id of 1, then id 1 in CoreEntity is the audit information for that person.

And what is the best way to make sure the Id matches in the core table? I was trying to do this with inheritance but the performance was less than great but it handled the Id logic pretty well.

So it is a couple pieces I am trying to figure out from what you can see.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down