跟随MyComponent.razor:
@inherits TableDropDown<ApplicationUser, string>
@{
base.BuildRenderTree(__builder);
}
@code {
public MyComponent()
{
ValueSelector = item => item.Užívateľ;
ChildContent = ctx =>
@<text>
<ColumnDef TRow="ApplicationUser" Context="user" Width="170px">@user.Username</ColumnDef>
<ColumnDef TRow="ApplicationUser" Context="user" Width="200px">@user.Name</ColumnDef>
</text>;
}
}
抛出错误:
CS0201仅分配,调用,递增,递减,等待和新建 对象表达式可以用作语句。
当我从lambda开头删除@
字符时,我得到:
CS0103当前上下文中不存在名称'__builder'