コード例 #1
0
 public static SdkRulesEngineRule ToSdkRulesEngineRule(this PSRulesEngineRule psRulesEngineRule)
 {
     return(new SdkRulesEngineRule
            (
                name: psRulesEngineRule.Name,
                priority: psRulesEngineRule.Priority,
                action: ToSdkRulesEngineAction(psRulesEngineRule.Action),
                matchConditions: psRulesEngineRule.MatchConditions?.Select(x => ToSdkMatchcondition(x)).ToList(),
                matchProcessingBehavior: psRulesEngineRule.MatchProcessingBehavior.ToString()
            ));
 }
コード例 #2
0
        public override void ExecuteCmdlet()
        {
            // Validations
            // Priority >= 0

            var rule = new PSRulesEngineRule
            {
                Name     = Name,
                Priority = Priority,
                Action   = Action,
            };

            if (this.IsParameterBound(c => c.MatchProcessingBehavior))
            {
                rule.MatchProcessingBehavior = MatchProcessingBehavior;
            }

            if (this.IsParameterBound(c => c.MatchCondition))
            {
                rule.MatchConditions = MatchCondition.ToList();
            }

            WriteObject(rule);
        }