From 838d9f2fe6dada752ea0260c8f10655d83d3817a Mon Sep 17 00:00:00 2001 From: Jericho Date: Sun, 24 Jan 2021 16:38:13 -0500 Subject: [PATCH] Make sure IRequest extension methods invoke their IResponse counterpart (cherry picked from commit 5644cc47b2c8cc49ad60a8dce65e44a2727328fa) --- Source/StrongGrid/Extensions/Internal.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/StrongGrid/Extensions/Internal.cs b/Source/StrongGrid/Extensions/Internal.cs index 8c3c3d01..f8328dad 100644 --- a/Source/StrongGrid/Extensions/Internal.cs +++ b/Source/StrongGrid/Extensions/Internal.cs @@ -214,8 +214,8 @@ internal static Task AsObject(this IResponse response, string propertyName /// An error occurred processing the response. internal static async Task AsObject(this IRequest request, string propertyName = null, bool throwIfPropertyIsMissing = true, JsonConverter jsonConverter = null) { - var response = await request.AsMessage().ConfigureAwait(false); - return await response.Content.AsObject(propertyName, throwIfPropertyIsMissing, jsonConverter).ConfigureAwait(false); + var response = await request.AsResponse().ConfigureAwait(false); + return await response.AsObject(propertyName, throwIfPropertyIsMissing, jsonConverter).ConfigureAwait(false); } /// Get a raw JSON object representation of the response, which can also be accessed as a dynamic value. @@ -229,8 +229,8 @@ internal static Task AsRawJsonObject(this IResponse response, string pr /// An error occurred processing the response. internal static async Task AsRawJsonObject(this IRequest request, string propertyName = null, bool throwIfPropertyIsMissing = true) { - var response = await request.AsMessage().ConfigureAwait(false); - return await response.Content.AsRawJsonObject(propertyName, throwIfPropertyIsMissing).ConfigureAwait(false); + var response = await request.AsResponse().ConfigureAwait(false); + return await response.AsRawJsonObject(propertyName, throwIfPropertyIsMissing).ConfigureAwait(false); } /// Get a raw JSON object representation of the response, which can also be accessed as a dynamic value. @@ -244,8 +244,8 @@ internal static Task AsRawJsonArray(this IResponse response, string prop /// An error occurred processing the response. internal static async Task AsRawJsonArray(this IRequest request, string propertyName = null, bool throwIfPropertyIsMissing = true) { - var response = await request.AsMessage().ConfigureAwait(false); - return await response.Content.AsRawJsonArray(propertyName, throwIfPropertyIsMissing).ConfigureAwait(false); + var response = await request.AsResponse().ConfigureAwait(false); + return await response.AsRawJsonArray(propertyName, throwIfPropertyIsMissing).ConfigureAwait(false); } /// Asynchronously retrieve the JSON encoded content and convert it to a 'PaginatedResponse' object.