How to fire fire and forget in async method?

winanjaya 146 Reputation points
2023-08-30T08:43:17.4466667+00:00

Hi All,

Net Core 6, How to call an async method but I don't want to wait it?

private static async Task Run_ForgetIt(object parameters)

{

}

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,228 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,303 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 57,646 Reputation points
    2023-08-30T15:24:10.4866667+00:00

    Just call it without an await or .Wait();

    var task = Run_ForgetIt(…);