How can I optimize the below code, the below code contains an object array that might have different type of class objects. I would prefer to move to switch case instead of if...else... how could I do it.
object[] emailObjs;
for (int i = 0; i < emailObjs.Length; i++)
{
if (emailObjs[i] != null)
{
if (emailObjs[i] is Rfq)
{
}
else if (emailObjs[i] is RfqBid)
{
}
else if (emailObjs[i] is RfqProjManager)
{
}
}
}