没有为段'x'找到资源
本文关键字:资源 | 更新日期: 2023-09-27 18:15:27
我得到这个错误:资源没有找到区段'GetTest'。
代码是这样的:
[WebGet]
public IQueryable<string> GetTest()
{
var tmp = new List<string>();
return tmp.AsQueryable();
}
有什么问题吗?
查找不存在的主键时引发"Resource not found for the segment"
try try-catch
try
{
var tmp = new List<string>();
return tmp.AsQueryable();
}
catch( DataServiceQueryException ex )
{
return null;
}