Exemplo n.º 1
0
        public static void VariableQueryArgumentSerializationCallback(object o, StreamingContext context)
        {
            var variableQueryArgument = o as VariableQueryArgument;

            if (!(variableQueryArgument?.Value is null))
            {
                var converter = PrimitiveValueInspector.GetConverter(variableQueryArgument.Type);
                if (!(converter is null))
                {
                    variableQueryArgument.Value = converter(variableQueryArgument.Value);
                }
            }
        }
Exemplo n.º 2
0
        public static void VariableQueryArgumentListSerializationCallback(object o, StreamingContext context)
        {
            var variableQueryArgumentList = o as VariableQueryArgumentList;

            if (!(variableQueryArgumentList?.Values is null))
            {
                var converter = PrimitiveValueInspector.GetConverter(variableQueryArgumentList.ElementType);
                if (!(converter is null))
                {
                    variableQueryArgumentList.Values = variableQueryArgumentList.Values.Select(converter).ToList();
                }
            }
        }
Exemplo n.º 3
0
        public static void ConstantExpressionSerializationCallback(object o, StreamingContext context)
        {
            var constantExpression = o as ConstantExpression;

            if (!(constantExpression?.Value is null))
            {
                var converter = PrimitiveValueInspector.GetConverter(constantExpression.Type);
                if (!(converter is null))
                {
                    constantExpression.Value = converter(constantExpression.Value);
                }
            }
        }