예제 #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="jsonBatchReader">The Json batch reader.</param>
        private ODataJsonLightBatchPayloadItemPropertiesCache(ODataJsonLightBatchReader jsonBatchReader)
        {
            Debug.Assert(jsonBatchReader != null, $"{nameof(jsonBatchReader)} != null");

            this.jsonReader             = jsonBatchReader.JsonLightInputContext.JsonReader;
            this.asynchronousJsonReader = jsonBatchReader.JsonLightInputContext.JsonReader;
            this.listener = jsonBatchReader;
        }
예제 #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="jsonBatchReader">The Json batch reader.</param>
        internal ODataJsonLightBatchPayloadItemPropertiesCache(ODataJsonLightBatchReader jsonBatchReader)
        {
            Debug.Assert(jsonBatchReader != null, "jsonBatchReader != null");

            this.jsonReader = jsonBatchReader.JsonLightInputContext.JsonReader;
            this.listener   = jsonBatchReader;

            ScanJsonProperties();
        }
예제 #3
0
        /// <summary>
        /// Creates a <see cref="ODataJsonLightBatchPayloadItemPropertiesCache"/>
        /// and subsequently scans the JSON object for known properties and caches them.
        /// </summary>
        /// <param name="jsonBatchReader">The JSON batch reader.</param>
        /// <returns>A <see cref="ODataJsonLightBatchPayloadItemPropertiesCache"/> instance.</returns>
        internal static ODataJsonLightBatchPayloadItemPropertiesCache Create(ODataJsonLightBatchReader jsonBatchReader)
        {
            Debug.Assert(jsonBatchReader != null, $"{nameof(jsonBatchReader)} != null");

            ODataJsonLightBatchPayloadItemPropertiesCache jsonLightBatchPayloadItemPropertiesCache = new ODataJsonLightBatchPayloadItemPropertiesCache(jsonBatchReader);

            jsonLightBatchPayloadItemPropertiesCache.ScanJsonProperties();

            return(jsonLightBatchPayloadItemPropertiesCache);
        }
예제 #4
0
        /// <summary>
        /// Asynchronously creates a <see cref="ODataJsonLightBatchPayloadItemPropertiesCache"/>
        /// and subsequently scans the JSON object for known properties and caches them.
        /// </summary>
        /// <param name="jsonBatchReader">The JSON batch reader.</param>
        /// <returns>
        /// A task that represents the asynchronous write operation.
        /// The value of the TResult parameter contains a <see cref="ODataJsonLightBatchPayloadItemPropertiesCache"/> instance.
        /// </returns>
        internal static async Task <ODataJsonLightBatchPayloadItemPropertiesCache> CreateAsync(ODataJsonLightBatchReader jsonBatchReader)
        {
            Debug.Assert(jsonBatchReader != null, $"{nameof(jsonBatchReader)} != null");

            ODataJsonLightBatchPayloadItemPropertiesCache jsonLightBatchPayloadItemPropertiesCache = new ODataJsonLightBatchPayloadItemPropertiesCache(jsonBatchReader);

            await jsonLightBatchPayloadItemPropertiesCache.ScanJsonPropertiesAsync()
            .ConfigureAwait(false);

            return(jsonLightBatchPayloadItemPropertiesCache);
        }