Beispiel #1
0
        public virtual T Materialize <T>()
        {
            Cosmos.Json.IJsonReader    cosmosJsonReader = this.CreateReader();
            Newtonsoft.Json.JsonReader newtonsoftReader = new CosmosDBToNewtonsoftReader(cosmosJsonReader);

            return(DefaultSerializer.Deserialize <T>(newtonsoftReader));
        }
Beispiel #2
0
        public virtual IJsonReader CreateReader()
        {
            IJsonWriter jsonWriter = JsonWriter.Create(JsonSerializationFormat.Binary);

            this.WriteTo(jsonWriter);

            ReadOnlyMemory <byte> buffer = jsonWriter.GetResult();

            Cosmos.Json.IJsonReader cosmosJsonReader = Cosmos.Json.JsonReader.Create(buffer);
            return(cosmosJsonReader);
        }