public void MinSelectedOptionsRuleCheck( ConfigurationItem configurationItem, MinSelectedOptionsRule rule, out string error) { error = string.Empty; var selectedCount = configurationItem.ConfigurationItemOptions.Count(o => o.IsSelected); if (selectedCount < rule.Count) { error = $"{configurationItem.Name} can have no more than {rule.Count} option(s)"; } }