Please refer to my signature for information about template set, version etc.
I want to enhance my Aentity so it is a Bentity. (B inherits from A)
I can't a add a B entity when I save an A entity, because A is a part of B.
Ok, perhaps this makes it clearer:
This is a method which gets an collection of AEntities and checks if they're BEntities, too. If not, the AEntiteis should be "Enhanced" by the lngFKUserRole-Field, which is the only additional field in BEntity. AFter that the AEntity became a BEntity and will be saved.
...
ACollection aColl = new ACollection();
aColl.GetMulti(null);
BEntity hlpEnt;
foreach (AEntity ent in aColl) {
if (ent is BEntity ) { continue; }
hlpEnt = (BEntity)ent; *
hlpEnt = MakeMeBEntity(ent); **
hlpEnt.LngPkUser = ent.LngPkMitarbeiter;
hlpEnt.LngFkUserRole = 1;
unitOfWork.AddForSave(hlpEnt);
}
...
*) I know this can't be done and i want to write a funktionalitiy which "enhances" the AEntity to be BEntity.
**) Another approach, instead of line *. Please help me to find the MakeMeBEntity() method!