I just started learning ASP.NET Core and I was following the YouTube tutorial from Microsoft (https://www.youtube.com/watch?v=wA-3FA2kbpA&list=PLdo4fOcmZ0oW8nviYduHq7bmKode-p8Wy&index=11) and when I tried to call the function on button click, it does not work.
The code is as follows:
Button in HTML
<button @onclick="(e => SelectProduct(product.Id))" data-toggle="modal" data-target="#productModal" class="btn btn-primary">More Info</button>
@Code Element - Function
void SelectProduct(string productId)
{
selectedProductId = productId;
selectedProduct = ProductService.GetProducts().First(x => x.Id == productId);
}
Kindly help me debug this. The function does not get called when the button is clicked.
Thanks in advance!

@onclickdoes not work for me. I have installed the dotnet version 3.1.101