我收到此错误:找不到段"GetTest"的资源.
代码是这样的:
[WebGet]
public IQueryable<string> GetTest()
{
var tmp = new List<string>();
return tmp.AsQueryable();
}
Run Code Online (Sandbox Code Playgroud)
有什么想法有什么不对?
查找不存在的主键时出现“未找到该段的资源”的错误
用 try-catch 尝试一下
try
{
var tmp = new List<string>();
return tmp.AsQueryable();
}
catch( DataServiceQueryException ex )
{
return null;
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1956 次 |
最近记录: |