나는 다음과 같은 예외가 점점 오전 :쿼리를 수락하고 비동기 작업을 반환하는 방법?
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을 잘못된? 내 crmEndPoint에 PathAndQuery를 추가하고 결과를 반환하려면 어떻게해야합니까?
해야 하는가가 아니라 하나로, OData 액션 메소드를 사용'된 IQueryable'반환 형식으로? –