If I have a base class and two derived classes, and I want to implement the casting between the two derived classes by hand, is there any way to do that? (in C#)
abstract class AbsBase
{
private int A;
private int B;
private int C;
private int D;
}
class Imp_A : AbsBase
{
private List<int> E;
}
class Imp_B : AbsBase
{
private int lastE;
}
Generally I'll be casting from Imp_A -> Imp_B and I want the last value in the E list to be the 'LastE'. Also, what if there were three or more implementation classes (such as Salary, Hourly, Consultant, and Former Employees.)
Regardless of whether this is architecturally sound (I can't describe the whole application and be concise) is it possible?
I was going to write a converter, except that to my understanding a converter will create a new object of the Imp_B class, which I don't need because the 'employee' will only be one of the options at any one time.
-Devin