接口任务错误 CS0050
interface task error CS0050
我有这个代码
public interface IWebInterfaceService
{
Task<LoadModel> GetContentAsync(string query);
}
"GetContentAsync" 显示错误:
Error CS0050 Inconsistent accessibility: return type 'Task<LoadModel>' is less accessible than method 'IWebInterfaceService.GetContentAsync(string)'
删除 public
关键字有帮助,但我希望界面为 public。在 Task<LoadModel>
之前添加 public
是不可能的。
这可能是因为 LoadModel 比您的界面更难访问。
制作 LoadModel public.
我有这个代码
public interface IWebInterfaceService
{
Task<LoadModel> GetContentAsync(string query);
}
"GetContentAsync" 显示错误:
Error CS0050 Inconsistent accessibility: return type 'Task<LoadModel>' is less accessible than method 'IWebInterfaceService.GetContentAsync(string)'
删除 public
关键字有帮助,但我希望界面为 public。在 Task<LoadModel>
之前添加 public
是不可能的。
这可能是因为 LoadModel 比您的界面更难访问。
制作 LoadModel public.