I have base class perDat. I have class mPerDat that derives from perDat. I also have class iPerDat class that derives from perDat. Two files that represent the mPerDat and iPerDat are exactly the same different only in class names and types, both inherit after perDat directly. And now the code:
mPerDat mPerDatObj = perDatObj as mPerDat;
iPerDat iPerDatObj = perDatObj as iPerDat;
if (mPerDatObj != null)
{ do something with mPerDatObj }
if (iPerDatObj != null)
{ do something with iPerDatObj }
The strange thing is, that mPerDatObj have nice object after casting, but the iPerDatObj does not. Where should I search for the problem?