@page "/"
<h1>@game.Name</h1>
Welcome to your new app.
<EditForm Model="@game" OnSubmit="HandleSubmit" FormName="a">
<InputText id="name" @bind-Value="game.Name" class="form-control" />
<button type="submit" class="btn btn-primary">PLEASE WORK</button>
</EditForm>
@code {
Game game = new Game(){
Genre = string.Empty,
Name = string.Empty
};
private void HandleSubmit()
{
Console.WriteLine($"Submitted: Name={game.Name}, Genre={game.Genre}, Price={game.Price}");
InvokeAsync(StateHasChanged);
//GameClient.AddGame(game);
//NavigationManager.NavigateTo("/");
}
public class Game
{
public int Id { get; set; }
public string Name { get; set; }
public string Genre { get; set; }
public decimal Price { get; set; }
}
}