我有以下 Silverlight 代码。
Container container = new Container("http://localhost:8080/odata");
DataServiceQuery dsq = container.MyEntity;
IEnumerable result = Task<IEnumerable>.Factory.FromAsync(dsq.BeginExecute, dsq.EndExecute, null).Result;
我遇到的问题dsq.EndExecute
是从未调用过。我观察了 Fiddler 中的 HTTP 流量和发出的请求,http://localhost:8080/odata/MyEntity
并收到了下面的响应。任务似乎并不承认收到了响应。
HTTP/1.1 200 OK
Server: ASP.NET Development Server/11.0.0.0
Date: Mon, 20 May 2013 15:04:16 GMT
X-AspNet-Version: 4.0.30319
DataServiceVersion: 3.0
Cache-Control: no-cache
Pragma: no-cache
Expires: -1
Content-Type: application/atom+xml; charset=utf-8
Content-Length: 562
Connection: Close
<?xml version="1.0" encoding="utf-8"?>
<feed xml:base="http://localhost:8080/odata/" xmlns="http://www.w3.org/2005/Atom"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">
<id>http://schemas.datacontract.org/2004/07/</id>
<title />
<updated>2013-05-20T15:04:16Z</updated>
<link rel="self" href="http://localhost:8080/odata/MyEntity" />
<author>
<name />
</author>
</feed>
难道我做错了什么?