In my Blazor page, I have this simple code (ToggleButtonGroup is from here).
<div class="col-lg-6"><label class="form-label form-field-label">Insert your value</label><ToggleButtonGroup Options="@GroupOptions.Options0To10" @bind-Value="@_session.InteractiveNumber" /><hr></div>The model I use is defined like that
public class Session { public int ActiveNumber { get; set; }}public Session _session = new();The ToggleButtonGroup returns a string as a value but I want to store in the database and this is why the Session is defined like that. How can I cast the value from a string to int? Can I use something like @(e => _session.ActiveNumber = e.ToString())?