public void Insert(Product entity) { Context.Insert(entity); if (entity is SolarPanel) { solarpanelLogic.Insert(entity as SolarPanel); } if (entity is MountingMaterial) { mountingMaterial.Insert(entity as MountingMaterial); } else if (entity is Inverter) { inverterLogic.Insert(entity as Inverter); } }