Question about downcasting an entity object

Posts   
 
    
jbliss1234
User
Posts: 42
Joined: 04-May-2007
# Posted on: 04-Aug-2010 03:52:10   

I have an inheritance hierarchy of FeeRecord <- PlanLevelFeeRecord <- ParticipantLevelFeeRecord. The maping is of type TargetPerEntity (each entity in its own table).

The ParticipantLevelFeeRecord differs from PlanLevelFeeRecord in that it has 1 extra field called SSN.

I have a particular row in the database that currently represents a PlanLevelFeeRecord entity, but due to a business rule, under certain conditions, I want to "convert" this PlanLevelFeeRecord into a ParticipantLevelFeeRecord by supplying an SSN value.

Is this possible to do with LLBLGen? If so, can you please send me a code snippet?

I would love to not have to manually insert a row into the ParticipantLevelFeeRecord table, which will likely work...

I am attaching a copy of the inheritance diagram


LLBLGen version 2.6, Visual Studio 2008, .Net 3.5

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 04-Aug-2010 10:07:09   

Is this possible to do with LLBLGen? If so, can you please send me a code snippet?

I would love to not have to manually insert a row into the ParticipantLevelFeeRecord table, which will likely work...

I am attaching a copy of the inheritance diagram

Not directly supported by LLBLGen, you'll have to insert the row manually. Or if you don't have references to your existing entity, you may copy it to a new ParticipantLevelFeeRecord entity, delete the original one and insert the new one.