Skip to content

Commit

Permalink
Add simple Execute back
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyzimarev committed May 30, 2024
1 parent 7334e28 commit 3c7d83c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/RestSharp/RestClient.Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ public static async Task<RestResponse<T>> ExecuteAsync<T>(
public static RestResponse<T> Execute<T>(this IRestClient client, RestRequest request)
=> AsyncHelpers.RunSync(() => client.ExecuteAsync<T>(request));

/// <summary>
/// Executes the request synchronously, authenticating if needed
/// </summary>
/// <typeparam name="T">Target deserialization type</typeparam>
/// <param name="client"></param>
/// <param name="request">Request to be executed</param>
public static RestResponse Execute(this IRestClient client, RestRequest request)
=> AsyncHelpers.RunSync(() => client.ExecuteAsync(request));

/// <summary>
/// Executes the request asynchronously, authenticating if needed
/// </summary>
Expand Down

0 comments on commit 3c7d83c

Please sign in to comment.