예제 #1
0
        public static Expression DeserializeBinary(PredyBinaryExpression binaryPredy)
        {
            Expression left  = DeserializeInternal(binaryPredy.Left);
            Expression right = DeserializeInternal(binaryPredy.Right);

            BinaryExpression binary = Expression.MakeBinary(binaryPredy.NodeType, left, right);

            return(binary);
        }
예제 #2
0
        public static void WriteBinary(JsonWriter writer, PredyBinaryExpression value, JsonSerializer serializer)
        {
            JObject jObject = new JObject
            {
                ["ExType"] = JToken.FromObject(PredyExpressions.Binary),
                [nameof(value.NodeType)] = JToken.FromObject(value.NodeType),
                [nameof(value.Left)]     = JToken.FromObject(value.Left, serializer),
                [nameof(value.Right)]    = JToken.FromObject(value.Right, serializer)
            };

            jObject.WriteTo(writer);
        }