Aspnetcore: Misleading error message [Blazor]

Created on 25 Jun 2020  路  3Comments  路  Source: dotnet/aspnetcore

When the Model passed to an EditForm is null, the error message says you cannot have both an EditContext and a Model.

Model can be null during rendering if set in OnInitializedAsync after an awaited call to a server, so this error won't be uncommon.

The error text used should be different if both EditContext and Model are null. Eg "An EditContext or Model is required"

The existing text implies you have both, rather than that you have neither.

area-blazor bug

All 3 comments

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we will planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

This has been addressed as part of #24007

This has been addressed as part of #24007

Good work :)

Was this page helpful?
0 / 5 - 0 ratings