Was unsure what to write in the title, they might not all be anonymous methods, but here goes:
Say we have this async function:
public async Task Delete(){
//something
}
I'm using Blazor server-side and I'm curious about the following four ways of calling a function. Lets say they are inside a div tag.
onclick="@Delete"onclick="@(() => Delete(id))"onclick="@(async () => await Delete(id))"onclick="@(e => Delete(person.Id))
I'm not sure if 1 is new to Blazor or not, but does it understand that the method is async or not?
2 and 3 would be used if it was needed to pass in a parameter, but I've never used the async-part before, only seen in older posts. Is it still needed to say "async () =>" ?