获取错误 RAZORGENERATE:错误 RZ3008 创建 Blazor ComponenBase
Getting error RAZORGENERATE : error RZ3008 creating Blazor ComponenBase
已升级到 Preview9。
但是当我尝试分离视图和模型时出现此错误,有什么想法吗?
RAZORGENERATE : error RZ3008: Tag helpers cannot target tag name
'.ViewCustomerModel' because it contains a '<'
character.
public class ViewCustomerModel: ComponentBase
{
[Inject]
protected IDataService Data {get;set;}
[Parameter]
public Guid CustomerId {get;set;}
public Customer Customer {get;set;}
protected override async Task OnInitializedAsync()
{
await Load();
}
private async Task Cancel() => await Load();
private async Task Load()
{
Customer = await Data.Load<Customer>(CustomerId);
}
private async Task Save(EditContext editContext)
{
if (editContext.Validate())
{
await Data.Save<Customer>(Customer);
}
}
}
根据 MSFT https://github.com/aspnet/AspNetCore/issues/13881
您始终需要命名空间,因此需要将 class 包装在命名空间中。
已升级到 Preview9。
但是当我尝试分离视图和模型时出现此错误,有什么想法吗?
RAZORGENERATE : error RZ3008: Tag helpers cannot target tag name '.ViewCustomerModel' because it contains a '<' character.
public class ViewCustomerModel: ComponentBase
{
[Inject]
protected IDataService Data {get;set;}
[Parameter]
public Guid CustomerId {get;set;}
public Customer Customer {get;set;}
protected override async Task OnInitializedAsync()
{
await Load();
}
private async Task Cancel() => await Load();
private async Task Load()
{
Customer = await Data.Load<Customer>(CustomerId);
}
private async Task Save(EditContext editContext)
{
if (editContext.Validate())
{
await Data.Save<Customer>(Customer);
}
}
}
根据 MSFT https://github.com/aspnet/AspNetCore/issues/13881
您始终需要命名空间,因此需要将 class 包装在命名空间中。