Here is what I am trying to do:
if (a==true)
{
dbA objectInstance = new dbA();
}
else
{
dbB objectInstance = new dbB();
}
objectInstance.Name = "New name";
I get "the name objectInstance does not exist in the current context", I assume because the def happens inside the conditional.
There must be a better pattern to do this - should I have dbA and dbB inherit from the same class?