/// <summary> /// Reads the next node from the <paramref name="jsonReader"/> as a URI and verifies that it is a PrimitiveValue node of type string. /// </summary> /// <param name="jsonReader">The <see cref="JsonReader"/> to read from.</param> /// <returns>The string value read from the reader as a URI; throws an exception if no string value could be read.</returns> internal static Uri ReadUriValue(this IJsonReader jsonReader) { return(UriUtils.StringToUri(ReadStringValue(jsonReader))); }
/// <summary> /// Asynchronously reads the next node from the <paramref name="jsonReader"/> as a URI and verifies that it is a PrimitiveValue node of type string. /// </summary> /// <param name="jsonReader">The <see cref="JsonReader"/> to read from.</param> /// <returns>A task that represents the asynchronous read operation. /// The value of the TResult parameter contains the string value read from the reader as a URI; /// throws an exception if no string value could be read.</returns> internal static async Task <Uri> ReadUriValueAsync(this IJsonReaderAsync jsonReader) { return(UriUtils.StringToUri(await ReadStringValueAsync(jsonReader) .ConfigureAwait(false))); }