I have 2 classes which share 9 of the 10 properties. I was trying to do what you see below but getting gc does not exist in current context. I was wondering if there is
if (methodId == 2)
{
var gc = new LblPremium(id);
}
else
{
var gc = new LblIsoReport(id);
}
gc.Nbr = Nbr;
if (method == 2) { gc.Location = "Location Identification: " + pvtData.Location; }
..
..
Try:
where
LblBaseis the base class ofLblPremiumandLblIsoReport.