System.InvalidOperationException: EditForm requires a Model parameter, or an EditContext parameter, but not both. means your <EditForm> was given both Model and EditContext. Its sibling, EditForm requires either a Model parameter, or an EditContext parameter, please provide one of these., means it got neither, and a Model that is still null counts as neither. Give the form exactly one, with a value.

For most forms, keep Model, delete EditContext, and make sure the model object exists before the first render, for example with appointment ??= new(); in OnInitialized.

The error

fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
      An unhandled exception has occurred while executing the request.
      System.InvalidOperationException: EditForm requires a Model parameter, or an EditContext parameter, but not both.
         at Microsoft.AspNetCore.Components.Forms.EditForm.OnParametersSet()
         at Microsoft.AspNetCore.Components.ComponentBase.CallOnParametersSetAsync()
...
fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
      An unhandled exception has occurred while executing the request.
      System.InvalidOperationException: EditForm requires either a Model parameter, or an EditContext parameter, please provide one of these.
         at Microsoft.AspNetCore.Components.Forms.EditForm.OnParametersSet()
         at Microsoft.AspNetCore.Components.ComponentBase.CallOnParametersSetAsync()

Both came from the dotnet run console, one per page; the stack traces continue for about twenty more framework frames. Each page answered with a 500 instead of HTML, because a statically rendered page fails as a whole.

Why it happens

The first page had added an EditContext to a form that already had a model:

<EditForm Model="@appointment" EditContext="@editContext" FormName="book" OnValidSubmit="Save">

EditForm hands one EditContext down to its inputs and validators; that object tracks which fields changed and the current validation messages. Given a Model, the form builds the context itself. Given an EditContext, it uses yours. Given both, it cannot know which one you meant, and the check in OnParametersSet throws rather than guess. Microsoft's forms documentation states the rule in one line: "If both are assigned, a runtime error is thrown."

The second message fired on two pages: one whose EditForm had no Model attribute at all, and one with Model="@appointment" where the [SupplyParameterFromForm] property had never been initialised. A null model is indistinguishable from a missing one, which makes this the more common of the two in practice.

The fix

<EditForm Model="@appointment" FormName="book" OnValidSubmit="Save">
    <DataAnnotationsValidator />
    <InputText @bind-Value="appointment!.PatientName" />
    <ValidationMessage For="() => appointment!.PatientName" />
    <button type="submit">Book</button>
</EditForm>

@code {
    [SupplyParameterFromForm] private Appointment? appointment { get; set; }

    protected override void OnInitialized() => appointment ??= new();

The page rendered with 200, and posting the form with its antiforgery token printed "Booked for Maria Garcia." A second version that keeps the EditContext and drops Model worked the same way:

<EditForm EditContext="@editContext" FormName="book" OnValidSubmit="Save">
...
    protected override void OnInitialized()
    {
        appointment ??= new();
        editContext = new EditContext(appointment);
    }

When is the EditContext worth it? Use Model unless your code needs to talk to the context: call Validate() yourself, ask IsModified() before navigating away, react to OnFieldChanged, or add server-side errors through a ValidationMessageStore. Then create the context once from the same model instance the inputs bind to, and pass only the context.

How it was reproduced

A Blazor Web App from dotnet new blazor -n FormLab -int None (static server rendering) on .NET SDK 10.0.402 with the ASP.NET Core 10.0.13 runtime. Five pages were added: both parameters, neither, a null model, Model only and EditContext only. With dotnet run --urls http://127.0.0.1:15620 running, curl.exe requested each page; the first three returned 500 with the messages above, the last two returned 200 and accepted a POST with the token and cookie from their own GET.

Frequently asked

Can I use Model and EditContext together on a Blazor EditForm?
No. EditForm accepts exactly one of them and throws if both are set. Use Model for ordinary forms, or create an EditContext from your model and pass only the EditContext.
Why does EditForm say it requires a Model parameter when I set one?
The value is null at the first render. A model property marked SupplyParameterFromForm starts as null, so assign it in OnInitialized, for example appointment ??= new(), before the form renders.
When should I use EditContext instead of Model in Blazor?
When your code needs the context itself: calling Validate manually, checking IsModified, handling OnFieldChanged or adding server-side messages with a ValidationMessageStore. For everything else Model is simpler.

More decoded errors in the Fixes category. For a full form with validation, see Blazor Forms and Validation, the Friendly Way.