Do not await an async method

Posted by Joe Enos on August 04, 2021 · 1 min read

From this answer on StackOverflow – to avoid the compiler warning you about not awaiting an async method. Not sure if this is the best answer, but it works for me:

public static class TaskExtensions
public static void DoNotAwait(this Task task) { }