<EditForm Model="cust" OnSubmit="HandleSubmit">
<InputNumber @bind-Value="@(this.Id == null? this.idNuM :cust._nunuy)" class="form-control"></InputNumber>
</EditForm>
我得到这个错误:
无法将lambda表达式转换为预期的委托类型,因为块中的某些返回类型不能隐式转换为委托返回类型
方法'RuntimeHelpers '的类型参数。createinterredeventcallback (object, Action, T)'不能从用法中推断出来。尝试显式指定类型参数。
我试过了:
<EditForm Model="cust" OnSubmit="HandleSubmit">
<InputNumber @bind-Value="@(this.Id == null? (ulong)this.idNuM : (long)cust._nunuy)" class="form-control"></InputNumber>
</EditForm>
试试这个
<EditForm Model="cust" OnSubmit="HandleSubmit">
<InputNumber @bind-Value="@(() =>this.Id == null? this.idNuM :cust._nunuy)" class="form-control"></InputNumber>
</EditForm>