public static void AddVariableToProfileModel(this VariableModel model, ProfileTypeDefinitionModel profileItem, IDALContext dalContext) { if (model is PropertyModel property) { property.AddVariableToProfileModel(profileItem, dalContext); } else if (model is DataVariableModel variable) { variable.AddVariableToProfileModel(profileItem, dalContext); } else { throw new Exception($"Unexpected variable type {model.GetType()}"); } }