Hi All I have the following:
<EditForm Model=@engineer FormName="Upsert" OnValidSubmit="SaveEngineer">
<div class="form-group row p-2">
<input type="hidden" @bind-value="engineer.id" />
<div class="col-md-6">
<input type="text" class="form-control" placeholder="Name" @bind-value="engineer.name" />
</div>
<div class="col-md-6">
<input type="text" class="form-control" placeholder="Country" @bind-value="engineer.country" />
</div>
</div>
<div class="form-group row p-2">
<div class="col-md-6">
<input type="text" class="form-control" placeholder="Speciality" @bind-value="engineer.speciality" />
</div>
</div>
<div class="form-group row p-2">
<div class="text-center">
<button type="submit" class="btn btn-primary">Save</button>
</div>
</div>
and in my code behind I have:
public Engineer engineer = new Engineer();
private async Task SaveEngineer()
{
await engineerService.UpsertEngineer(engineer);
NavManager.NavigateTo("/");
}
After placing values in the input fields and pressing the Save button, engineer values are all null.