public Filter ToFilter(QueryDescription qd, bool canAggregate) { var options = SubTokensOptions.CanElement | SubTokensOptions.CanAnyAll | (canAggregate ? SubTokensOptions.CanAggregate : 0); var parsedToken = QueryUtils.Parse(token, qd, options); var expectedValueType = operation.IsList() ? typeof(ObservableCollection <>).MakeGenericType(parsedToken.Type.Nullify()) : parsedToken.Type; var val = value is JToken ? ((JToken)value).ToObject(expectedValueType, JsonSerializer.Create(GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings)) : value; return(new Filter(parsedToken, operation, val)); }
public override Filter ToFilter(QueryDescription qd, bool canAggregate) { var options = SubTokensOptions.CanElement | SubTokensOptions.CanAnyAll | (canAggregate ? SubTokensOptions.CanAggregate : 0); var parsedToken = QueryUtils.Parse(token, qd, options); var expectedValueType = operation.IsList() ? typeof(ObservableCollection <>).MakeGenericType(parsedToken.Type.Nullify()) : parsedToken.Type; var val = value is JToken jtok? jtok.ToObject(expectedValueType, JsonSerializer.Create(SignumServer.JsonSerializerSettings)) : value; return(new FilterCondition(parsedToken, operation, val)); }
public Filter(QueryToken token, FilterOperation operation, object value) { this.token = token; this.operation = operation; this.value = ReflectionTools.ChangeType(value, operation.IsList() ? typeof(IEnumerable <>).MakeGenericType(Token.Type.Nullify()) : Token.Type); }
public Filter(QueryToken token, FilterOperation operation, object value) { this.token = token; this.operation = operation; this.value = ReflectionTools.ChangeType(value, operation.IsList() ? typeof(IEnumerable<>).MakeGenericType(Token.Type.Nullify()) : Token.Type); }