This is an implementation of a ReSharper Plugin that converts your synchronous code to it's asynchronous version and helps you to write your own asynchronous applications.
Convert Any Method to It's Async Implementation
- Replace a returning type with generic or non-generic
- Rename a hierarchy of overridden methods from <MethodName> to <MethodName>Async
- Add the
System.Threading.Tasksto a usings declaration
- Analyze a method body and replace the every synchronous call with it's
asyncimplementation if exists.
- Analyze a method body and replace the every
.Resultcall with the
- Analyze usage of a processed method. If the method is called from
asynccontext the AsyncConverter will replace it's call with the
awaitexpression, otherwise it will just call
In case that an expected returning type is
Task<int> but an actual returning type is
int, AsyncConverter will notice you that you can wrap a returning value with
If expected returning type is
Task<T> but null is returned instead, AsyncConverter warn you that execution point can await expected 'Task' and get
Async suffix in a method name
AsyncConverter will suggest you to add the
Async suffix to an asynchronous method name in all cases except:
- Classes inherited from
- Methods of test classes. NUnit, XUnit and MsUnit are supported. This may be turn off in Resharper → Options → Code Inspection → Async Converter → Async Suffix
Suggesting to configure an every await expression with ConfigureAwait
Suggesting to use the async method if exists
If a synchronous method is called in the async context and it's asynchronous implementation is exists (e.g method has same signature
Async suffix and
Task<T> as the returning type) AsyncConverter will suggest you to use this asynchronous implementation.
Do not suggest to use obsolete async methods.
await expression can be ignored if this
await expression is the single in a method and awaited value is returned from a method.