Generate automatically async/await code from sync code with Roslyn

added by DotNetKicks
12/27/2018 4:00:29 PM


For Scriban, I wanted to have all this async/await version of the library entirely generated, so that whenever I update the synchronous code, I can automatically generate the async/await version. While implementing this, I found an old GitHub issue on Roslyn "Automatically create non-async methods from async methods" and that it was also experimented on the project npgsql via AsyncRewriter done by Shay Rojansky (Hey Shay!).