I am migrating my Blazor Server from .NET 7 to 8. Apparently it causes error on calling the function this way:
<input type="checkbox" class="form-check" checked="@isChecked" @onchange="@((e) => AddRemoveSelection((int)i.Id!, Convert.ToBoolean(e.Value)))" />The compiler says
The delegate type could not be inferred
and highlighted => arrow function with red underline.
Here is the method:
private void AddRemoveSelection(int id, bool isSelected){ if (isSelected) { // Adding ids to selection if (!selectedIds.Any(s => s == id)) { selectedIds.Add(id); } } else { var s = selectedIds.Find(s => s == id); selectedIds.Remove(s); }}Is there any change in Blazor on .NET 8 that disables this syntax?