From 3c7d83c2be91bee386dcc6a27ff19b1b65daccaf Mon Sep 17 00:00:00 2001 From: Alexey Zimarev Date: Thu, 30 May 2024 13:16:44 +0200 Subject: [PATCH] Add simple Execute back --- src/RestSharp/RestClient.Extensions.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/RestSharp/RestClient.Extensions.cs b/src/RestSharp/RestClient.Extensions.cs index 5ac631d87..3a82494cd 100644 --- a/src/RestSharp/RestClient.Extensions.cs +++ b/src/RestSharp/RestClient.Extensions.cs @@ -50,6 +50,15 @@ public static async Task> ExecuteAsync( public static RestResponse Execute(this IRestClient client, RestRequest request) => AsyncHelpers.RunSync(() => client.ExecuteAsync(request)); + /// + /// Executes the request synchronously, authenticating if needed + /// + /// Target deserialization type + /// + /// Request to be executed + public static RestResponse Execute(this IRestClient client, RestRequest request) + => AsyncHelpers.RunSync(() => client.ExecuteAsync(request)); + /// /// Executes the request asynchronously, authenticating if needed ///