<EditForm EditContext="@EditContext" OnValidSubmit="HandleValidSubmit">
</EditForm>
@code
{
private EditContext EditContext;
private Client client= new Client() { };
protected override void OnInitialized()
{
EditContext = new EditContext(client);
base.OnInitialized();
}
}
As you can see, you can initially initialize the EditContext object with an instance of the Client class, and when your user make a choice, you can initialize the EditContext instance with a new instance of EditContext, like this:
ClientCompany client= new ClientCompany () { };
EditContext = new EditContext(client);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…