/// <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; }
/// <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(); }
/// <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); }
/// <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); }