public CollectionNotEmptyExpression(ResourceFieldChainExpression targetCollection, FilterExpression filter)
        {
            ArgumentGuard.NotNull(targetCollection, nameof(targetCollection));

            TargetCollection = targetCollection;
            Filter           = filter;
        }
Esempio n. 2
0
        public SortElementExpression(ResourceFieldChainExpression targetAttribute, bool isAscending)
        {
            ArgumentGuard.NotNull(targetAttribute, nameof(targetAttribute));

            TargetAttribute = targetAttribute;
            IsAscending     = isAscending;
        }
Esempio n. 3
0
 public MatchTextExpression(ResourceFieldChainExpression targetAttribute, LiteralConstantExpression textValue,
                            TextMatchKind matchKind)
 {
     TargetAttribute = targetAttribute ?? throw new ArgumentNullException(nameof(targetAttribute));
     TextValue       = textValue ?? throw new ArgumentNullException(nameof(textValue));
     MatchKind       = matchKind;
 }
        public QueryStringParameterScopeExpression(LiteralConstantExpression parameterName, ResourceFieldChainExpression scope)
        {
            ArgumentGuard.NotNull(parameterName, nameof(parameterName));

            ParameterName = parameterName;
            Scope         = scope;
        }
Esempio n. 5
0
        public MatchTextExpression(ResourceFieldChainExpression targetAttribute, LiteralConstantExpression textValue, TextMatchKind matchKind)
        {
            ArgumentGuard.NotNull(targetAttribute, nameof(targetAttribute));
            ArgumentGuard.NotNull(textValue, nameof(textValue));

            TargetAttribute = targetAttribute;
            TextValue       = textValue;
            MatchKind       = matchKind;
        }
Esempio n. 6
0
        public EqualsAnyOfExpression(ResourceFieldChainExpression targetAttribute,
                                     IReadOnlyCollection <LiteralConstantExpression> constants)
        {
            TargetAttribute = targetAttribute ?? throw new ArgumentNullException(nameof(targetAttribute));
            Constants       = constants ?? throw new ArgumentNullException(nameof(constants));

            if (constants.Count < 2)
            {
                throw new ArgumentException("At least two constants are required.", nameof(constants));
            }
        }
Esempio n. 7
0
        public override QueryExpression PaginationElementQueryStringValue(PaginationElementQueryStringValueExpression expression, TArgument argument)
        {
            if (expression != null)
            {
                ResourceFieldChainExpression newScope = expression.Scope != null?Visit(expression.Scope, argument) as ResourceFieldChainExpression : null;

                var newExpression = new PaginationElementQueryStringValueExpression(newScope, expression.Value);
                return(newExpression.Equals(expression) ? expression : newExpression);
            }

            return(null);
        }
Esempio n. 8
0
        private static void ConvertChainToElement(ResourceFieldChainExpression chain, MutableIncludeNode rootNode)
        {
            MutableIncludeNode currentNode = rootNode;

            foreach (var relationship in chain.Fields.OfType <RelationshipAttribute>())
            {
                if (!currentNode.Children.ContainsKey(relationship))
                {
                    currentNode.Children[relationship] = new MutableIncludeNode(relationship);
                }

                currentNode = currentNode.Children[relationship];
            }
        }
Esempio n. 9
0
        public override QueryExpression VisitQueryStringParameterScope(QueryStringParameterScopeExpression expression, TArgument argument)
        {
            if (expression != null)
            {
                var newParameterName = Visit(expression.ParameterName, argument) as LiteralConstantExpression;

                ResourceFieldChainExpression newScope = expression.Scope != null?Visit(expression.Scope, argument) as ResourceFieldChainExpression : null;

                var newExpression = new QueryStringParameterScopeExpression(newParameterName, newScope);
                return(newExpression.Equals(expression) ? expression : newExpression);
            }

            return(null);
        }
Esempio n. 10
0
 public override QueryExpression VisitResourceFieldChain(ResourceFieldChainExpression expression, TArgument argument)
 {
     return(expression);
 }
 public QueryStringParameterScopeExpression(LiteralConstantExpression parameterName, ResourceFieldChainExpression scope)
 {
     ParameterName = parameterName ?? throw new ArgumentNullException(nameof(parameterName));
     Scope         = scope;
 }
Esempio n. 12
0
 public CountExpression(ResourceFieldChainExpression targetCollection)
 {
     TargetCollection = targetCollection ?? throw new ArgumentNullException(nameof(targetCollection));
 }
Esempio n. 13
0
 public PaginationElementQueryStringValueExpression(ResourceFieldChainExpression scope, int value)
 {
     Scope = scope;
     Value = value;
 }
Esempio n. 14
0
 public EqualsAnyOfExpression(ResourceFieldChainExpression targetAttribute,
                              IReadOnlyCollection <LiteralConstantExpression> constants)
 {
     TargetAttribute = targetAttribute ?? throw new ArgumentNullException(nameof(targetAttribute));
     Constants       = constants ?? throw new ArgumentNullException(nameof(constants));
 }
 public SortElementExpression(ResourceFieldChainExpression targetAttribute, bool isAscending)
 {
     TargetAttribute = targetAttribute ?? throw new ArgumentNullException(nameof(targetAttribute));
     IsAscending     = isAscending;
 }
Esempio n. 16
0
        public CountExpression(ResourceFieldChainExpression targetCollection)
        {
            ArgumentGuard.NotNull(targetCollection, nameof(targetCollection));

            TargetCollection = targetCollection;
        }