I have an async function in C# as follows:
private static async Task AddEmoji(string emoji)
{
...
}
I have a situation where I'd like to call it but I don't want to wait for its result and I don't care if it works or not. What's the right way to go about this? I thought I could just call it without adding the async parameter:
AddEmoji("");
... which works, but VS gives me a CS4014 compile warning, so I guess that's not right. I then tried to create a Task for it:
Task.Run(() => await AddEmoji(""));
But that gives me an actual compile error:
Error CS4034 The 'await' operator can only be used within an async lambda expression. Consider marking this lambda expression with the 'async' modifier.
What's the right way to go about this?