I am learning this new Blazor framework and was wondering what is the difference between using EditForm and it's components vs regular html inputs vs direct assigning from code for posting into database.
For example Input and InputText:
<EditForm Model="Advert" OnValidSubmit="Create">
<Input @bind-Value="advert.City" />
<InputText @bind-Value="advert.City"/>
</EditForm>
And directly from code by assigning a value advert.City="London. Does it cause any disadvantages or security issues?
public async Task Create()
{
try
{
advert.City = "London";
await advertRepository.CreateAd(advert);
//navigationManager.NavigateTo("ProductsList");
}
catch (Exception ex)
{
//...
Console.WriteLine(ex.Message);
}
}