public CollectionNotEmptyExpression(ResourceFieldChainExpression targetCollection, FilterExpression filter) { ArgumentGuard.NotNull(targetCollection, nameof(targetCollection)); TargetCollection = targetCollection; Filter = filter; }
public SortElementExpression(ResourceFieldChainExpression targetAttribute, bool isAscending) { ArgumentGuard.NotNull(targetAttribute, nameof(targetAttribute)); TargetAttribute = targetAttribute; IsAscending = isAscending; }
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; }
public MatchTextExpression(ResourceFieldChainExpression targetAttribute, LiteralConstantExpression textValue, TextMatchKind matchKind) { ArgumentGuard.NotNull(targetAttribute, nameof(targetAttribute)); ArgumentGuard.NotNull(textValue, nameof(textValue)); TargetAttribute = targetAttribute; TextValue = textValue; MatchKind = matchKind; }
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)); } }
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); }
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]; } }
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); }
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; }
public CountExpression(ResourceFieldChainExpression targetCollection) { TargetCollection = targetCollection ?? throw new ArgumentNullException(nameof(targetCollection)); }
public PaginationElementQueryStringValueExpression(ResourceFieldChainExpression scope, int value) { Scope = scope; Value = value; }
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; }
public CountExpression(ResourceFieldChainExpression targetCollection) { ArgumentGuard.NotNull(targetCollection, nameof(targetCollection)); TargetCollection = targetCollection; }