Hello,
We have a inheritance hierarchy in database:
Party
Person (Inherits from Party)
Employee (Inherits from Person)
PayrollEmployee (Inherits from Employee)
Now we are doing a composable application that decides at runtime what modules are present and accordingly the form shown contains just Employee or Employee and Payroll Employee. The save button needs to now save both.
So for test code, we first save Employee, then PayrollEmployee in which we specify the same Guid and Employee object. However we get exception of Primary Key violation. Obviously the PayrollEmployee is trying to create a new hierarchy and GUID is same.
So is there a way to use the hierarchy and still be able to save both in sequence. We do need to save both as the Employee module cannot know if Payroll module is present or not. So Employee module is only doing its part. It is the payroll module which is dependent on Employee and need to adjust for the difference.
Please suggest.
Amit Jindal