当使用ADO.Net数据服务客户端通过调用刷新的实体LoadProperty
:资源未找到部分“财产”
ctx.BeginLoadProperty(this, "Owner", (IAsyncResult ar) => ...
如果属性是null
Error: Exception Thrown: System.Data.Services.DataServiceException: Resource not found for the segment 'Owner'. at System.Data.Services.RequestDescription.GetSingleResultFromEnumerable(SegmentInfo segmentInfo) at System.Data.Services.DataService1.CompareETagAndWriteResponse(RequestDescription description, ContentFormat responseFormat, IDataService dataService)
at System.Data.Services.DataService1.SerializeResponseBody(RequestDescription description, IDataService dataService) at System.Data.Services.DataService1.HandleNonBatchRequest(RequestDescription description) at System.Data.Services.DataService`1.HandleRequest()
问题是客户端不知道该属性是否为null
或者尚未填充。业主是从Vehicle
到Customer
的链接。
任何想法有什么不对?
谢谢
这[其他答案](http://stackoverflow.com/questions/505761/resource-not-found-for-segment-property/5987733#5987733)是一个更好的选择。提高代码的可读性。 – 2011-11-15 03:32:44