升级到Preview9。
但是当我试图将视图和模型分开时,有什么想法吗?
RAZORGENERATE : error RZ3008: target不能将标签名“.ViewCustomerModel”作为目标,因为它包含一个“<”字符。
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);
}
}
}发布于 2019-09-12 08:01:49
根据MSFT https://github.com/aspnet/AspNetCore/issues/13881
始终需要命名空间,需要将类包装在命名空间中。
https://stackoverflow.com/questions/57883628
复制相似问题