private ODataServiceDocument ReadServiceDocument(string payload)
        {
            MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(payload));
            ODataJsonLightServiceDocumentDeserializer deserializer = CreateODataJsonServiceDocumentDeserializer(stream);

            return(deserializer.ReadServiceDocument());
        }
Exemple #2
0
        private async Task SetupJsonLightServiceDocumentDeserializerAndRunTestAsync(
            string payload,
            Func <ODataJsonLightServiceDocumentDeserializer, Task> func)
        {
            using (var jsonInputContext = CreateJsonLightInputContext(payload, isAsync: true))
            {
                var jsonLightServiceDocumentDeserializer = new ODataJsonLightServiceDocumentDeserializer(jsonInputContext);

                await func(jsonLightServiceDocumentDeserializer);
            }
        }
Exemple #3
0
        private ODataServiceDocument ReadServiceDocument(string payload)
        {
            ODataServiceDocument serviceDocument;

            using (var jsonInputContext = CreateJsonLightInputContext(payload, isAsync: false))
            {
                var jsonLightServiceDocumentDeserializer = new ODataJsonLightServiceDocumentDeserializer(jsonInputContext);

                serviceDocument = jsonLightServiceDocumentDeserializer.ReadServiceDocument();
            }

            return(serviceDocument);
        }