我已经使用和edmx(xml)文件向我的项目添加了OData Connected Service。 一切看起来都很好,但是当我尝试将响应转换为列表引发和错误时,提示:“响应有效负载无效。请验证主要级别元素是Atom或Json或Appartein到名称空间:“ http://schemas.microsoft.com/ado/2007/08/dataservices”
Uri uri = new Uri("my uri");
NetworkCredential credentials = new NetworkCredential();
credentials.UserName = "username";
credentials.Password = "password";
credentials.Domain = "";
API_SALES_ORDER_SRV_Entities context = new API_SALES_ORDER_SRV_Entities(uri);
context.Credentials = credentials;
var query = (from t
in context.A_SalesOrder
select t).ToList();
我尝试将上下文的属性DataNamespace设置为JSON,但它表示该属性已过时。
我不太了解如何解决它。
谢谢