public RuleMatchData GetCustomLabelValue(IProductData productData, FeedRuleType feedRuleType) { RuleMatchData result = null; IRuleEvaluationResult ruleResult = null; switch (feedRuleType) { case (FeedRuleType.Custom_Label_0): { ruleResult = _customLabel0Service.GetEvaluationResult(productData, feedRuleType); break; } case (FeedRuleType.Custom_Label_1): { ruleResult = _customLabel1Service.GetEvaluationResult(productData, feedRuleType); break; } case (FeedRuleType.Custom_Label_2): { ruleResult = _customLabel2Service.GetEvaluationResult(productData, feedRuleType); break; } case (FeedRuleType.Custom_Label_3): { ruleResult = _customLabel3Service.GetEvaluationResult(productData, feedRuleType); break; } case (FeedRuleType.Custom_Label_4): { ruleResult = _customLabel4Service.GetEvaluationResult(productData, feedRuleType); break; } } if (ruleResult != null && ruleResult.HasMatch) { result = new RuleMatchData { IsDefaultMatch = ruleResult.IsDefaultMatch, Value = ruleResult.MatchingRulePayLoads.First() } } ; return(result); }
public static string GetCustomLabelValue(IGooglePlaFeedRuleHelper runnerFeed, IProductData productData, FeedRuleType feedRuleType) { var customLabelValue = runnerFeed.GetCustomLabelValue(productData, feedRuleType); return(customLabelValue != null ? customLabelValue.Value : null); }