How to start an async method without await its completion?

A standalone discard is the best way to avoid this warning.

_ = Task.Run(() =>  _emailService.SendEmailAsync());

Discards are dummy variables and can be used to ignore the Task object returned by an asynchronous operation.

https://learn.microsoft.com/en-us/dotnet/csharp/discards#a-standalone-discard

Leave a Comment