Injected Base Type Example
Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1886
Printed Date: 21-Apr-2026 at 10:39am
Topic: Injected Base Type Example
Posted By: jmarbutt
Subject: Injected Base Type Example
Date 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.
|
Replies:
Posted By: GregD
Date 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 {
}
}
|
|
Posted By: jmarbutt
Date 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.
|
|