Execute async method on button click in blazor
问题 I created a "Razor Components" project. I am trying to execute an asynchronous method when pressing a button, but could not figure out the syntax yet. This is my Index.razor : @page "/" @inject GenericRepository<Person> PersonRepository // ... @foreach (var person in persons) { <button onclick="@(() => Delete(person.Id))">❌</button> } @functions { // ... async void Delete(Guid personId) { await this.PersonRepository.Delete(personId); } } When I click the button, nothing happens. I tried