0
我得到以下异常:如何接受查询并返回异步任务?
Cannot create an EDM model as the action 'Get' on controller 'Accounts' has a return type 'System.Web.Http.IHttpActionResult' that does not implement IEnumerable<T>.
当试图查询我的终点:我在做什么
public async Task<IHttpActionResult> Get(ODataQueryOptions options)
{
var query = options.Request.RequestUri.PathAndQuery;
var client = new HttpClient();
var crmEndPoint = @"HTTPS://MYCRMORG.COM/API/DATA/V8.1/";
HttpResponseMessage response = await client.GetAsync(crmEndPoint+query);
object result;
if (response.IsSuccessStatusCode)
{
result = await response.Content.ReadAsAsync<object>();
return Ok(result);
}
return NotFound();
}
:
http://localhost:8267/api/accounts
正在做的工作的AccountsController错误?我如何简单地将PathAndQuery添加到我的crmEndPoint并返回结果?
应该不是OData的操作方法使用IQueryable的''作为返回类型? –