コード例 #1
0
        public QueryExpression FromJson(string json)
        {
            IReferenceResolver resolver = new QueryReferenceResolver();

            settings.ReferenceResolverProvider = () => { return(resolver); };
            settings.Context = new StreamingContext(StreamingContextStates.Other, resolver);
            return(JsonConvert.DeserializeObject <QueryExpression>(json, settings));
        }
コード例 #2
0
        public string ToJson(QueryExpression query)
        {
            IReferenceResolver resolver = new QueryReferenceResolver();

            settings.ReferenceResolverProvider = () => { return(resolver); };
            settings.Context = new StreamingContext(StreamingContextStates.Other, resolver);
            return(JsonConvert.SerializeObject(query, settings));
        }