public static FilterAggregateRule Copy(this FilterAggregateRule rule)
 {
     return(new FilterAggregateRule
     {
         ClaimKey = rule.ClaimKey,
         ClaimValue = rule.ClaimValue,
         Id = rule.Id,
         Operation = rule.Operation
     });
 }
Exemplo n.º 2
0
        public static FilterRule ToModel(this FilterAggregateRule filterRule)
        {
            if (filterRule == null)
            {
                throw new ArgumentNullException(nameof(filterRule));
            }

            return(new FilterRule
            {
                ClaimKey = filterRule.ClaimKey,
                ClaimValue = filterRule.ClaimValue,
                Operation = (int)filterRule.Operation
            });
        }
        public static FilterRuleResponse ToDto(this FilterAggregateRule rule)
        {
            if (rule == null)
            {
                throw new ArgumentNullException(nameof(rule));
            }

            return(new FilterRuleResponse
            {
                Id = rule.Id,
                ClaimKey = rule.ClaimKey,
                ClaimValue = rule.ClaimValue,
                Operation = (ComparisonOperationsDto)rule.Operation
            });
        }