当使用 ADO.Net Data Services 客户端通过调用刷新实体时LoadProperty
:
ctx.BeginLoadProperty(this, "Owner", (IAsyncResult ar) => ...
如果该属性是,它会在服务器上引发错误null
错误:抛出异常:System.Data.Services.DataServiceException:
找不到段“所有者”的资源。在
System.Data.Services.RequestDescription.GetSingleResultFromEnumerable(SegmentInfo
段信息)位于
System.Data.Services.DataService1.CompareETagAndWriteResponse(RequestDescription
描述、ContentFormat 响应格式、IDataService 数据服务)
在
System.Data.Services.DataService1.SerializeResponseBody(RequestDescription
描述,IDataService dataService)位于
System.Data.Services.DataService1.HandleNonBatchRequest(RequestDescription
描述)位于 System.Data.Services.DataService`1.HandleRequest()
问题是客户不知道该房产是否是null
或者只是尚未填充。财产所有者是来自以下链接的链接Vehicle
to a Customer
.
任何想法有什么问题吗?
Thanks
Set 忽略资源未发现异常 http://msdn.microsoft.com/en-us/library/system.data.services.client.dataservicecontext.ignoreresourcenotfoundexception.aspx服务上下文的属性为 true:
svc.IgnoreResourceNotFoundException = true;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)