Restsharp: ExecuteTaskAsync marked as obsolete

Created on 10 Jan 2020  路  6Comments  路  Source: restsharp/RestSharp

Expected Behavior

Methods only marked as obsolete if there is an alternative available to use.

Actual Behavior

All the async methods on IRestClient have been marked as obsolete ( e.g. ExecuteTaskAsync which returns Task> .

This means a whole load of compile time warnings/errors (all of our projects have warnings as errors enabled).

The only way round this is to either suppress this specific compile time warning (undesirable as will not then pick up on other uses of obsolete methods), or to go through and individually suppress the warning for each usage of these methods (hundreds of lines of code changes).

I would understand the use of Obsolete here if there was another alternative method call we should be using instead- but there isn't ! I'm not sure of the value that the Obsolete attribute is providing on these ExecuteTaskAsync methods- these are not obsolete as far as I can see as there is no alternative to use? Nor is it really useful to be told these are going to be renamed - as there's nothing I can do about it anyway.

Steps to Reproduce the Problem

  1. Write some code using IRestClient, call ExecuteTaskAsync
  2. Observe that compile warnings are created

Specifications

  • Version: 106.10.0 (commit 620a0feec06d4b981364fb20fabcf53039d2b0d9 )
  • Platform:
  • Subsystem:

Most helpful comment

Ok, I completed the work on new methods now.

All 6 comments

I ran into the same problem.

I am open to suggestions. The naming is bad in the first place. ExecuteAsync should've been used but it is how it is, the ExecuteAsync method is now used for the method signature that uses callback delegate and other parameters and that method will be removed.

Okay that explains it a bit more.
I'm just going to have to ignore those warnings for now then.

Ok, I am able to make the ExecuteAsync method with the same signature as ExecuteTaskAsync.

I will continue moving to new names as far as signatures don't overlap. Hopefully, the next version will be better in that regard.

Ok, I completed the work on new methods now.

Thanks for sorting

Was this page helpful?
0 / 5 - 0 ratings

Related issues

captnrob picture captnrob  路  3Comments

ChenJasonGit picture ChenJasonGit  路  5Comments

abishekrsrikaanth picture abishekrsrikaanth  路  3Comments

Taher-Assad picture Taher-Assad  路  5Comments

maximuss picture maximuss  路  3Comments