问题标签 [odata]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
.net-2.0 - .Network 2.0 的 OData 客户端
是否有可以在 .Network 2 应用程序中使用 OData 服务的客户端?还没有找到明确的答案/例子。
asp.net-mvc - OData WCF Data Services - Related data (by foreign key) doesn't show up when calling the service
When I get the data using the URL in browser, I'm able to see the related data, for example:
http://localhost/services.svc/Dinners(1)/RSVPs
That lists 5 RSVPs for DinnerId = 1 in my case, but when I'm consuming the OData from a different project, I can only retrieve Dinners, debugging the app shows that RSVPs = 0, while it should be 5.
I'm consuming the service by adding a Service Reference to my project, and returning the data via a very simple LINQ query:
Any idea why d.RSVPs = 0 when it should be populated? I'm using EF (Code first - followed a post by ScottGu, with 2 very simple POCO classes for Dinner and RSVP. Dinner class have the collection of RSVPs: public ICollection<RSVP> RSVPs { get; set; }
, and the RSVP class points to the Dinner with a foreign key public int DinnerId { get; set; }
as well as the Dinner class: public Dinner Dinner { get; set; }
.
Thanks.
wcf - Reading BLOBS: Media Link Entry in OData
For reading BLOBS in a OData Service, I am using the DataServiceContext.GetReadStream() The GetReadStream method synchronously requests a data stream that contains the binary property of the requested entity.
In the AtomPub protocol, the entity is a Media Link Entry and the binary property is the associated Media Resource.
In the code I am using the proxy generated using Datasvcutil.exe. The proxy generates many classes for the entities. Is there any property to detect whether the given entity has binary stream or not.
Currently I call dataSvcContext.GetReadStream(customer)
and getting ArgumentException for an entity that does not have Media Link property or binary property.
Is there any method available to detect whether entity has binary property or not?
silverlight - 从多个 BackgroundWorker 调用时锁定 OData DataServiceContext
我有一个连接到 OData 服务的 Silverlight 4 应用程序。我的模型正在并行向服务提交多个查询,并且在查询回调中,我正在使用后台工作程序处理结果。
如果我正在拨打一个电话,这很好用,但是一旦我同时拨打多个电话 - 有时它会起作用 - 但大多数时候我在调用 EndExecute 时在数据服务上下文中遇到异常(它似乎是它正在将实体添加到其内部更改跟踪机制中。)
所以我决定在我调用 EndExecute 的时候锁定数据服务
这解决了问题,现在它可以可靠地处理数据请求。
我的问题是双重的 - 这是推荐的做法吗?OData 上下文不是线程安全的吗?
wcf - 从 oData 响应中省略元数据
我正在尝试针对 WCF oData API 编写 Javascript/JSONP 查询。出于性能原因,我试图使回答保持简洁。默认似乎是 oData 端点返回 uri 并在每个返回的结果中键入元数据。此信息可能占据响应负载的很大一部分。有没有办法让 oData 端点忽略这些信息?
c# - System.NotSupportedException:只能投影正在翻译的查询中的最后一个实体类型
我将 LINQ 与 ODATA Web 服务一起使用
看起来很简单,对吧?轮胎是 TyrePatterns 的一个属性。所以只是为了确保你能看到我想要做的事情,我在神奇的 SQL 世界中所做的事情看起来像:
在我们的网站和 LINQPad 中,LINQ 代码给出了运行时错误:
System.NotSupportedException:只能投影正在翻译的查询中的最后一个实体类型。
深入了解这个错误的实际含义,一个解决方案会很棒。
java - 如何在 odata4j 中按日期范围过滤实体?
odata4j AppEngineConsumerExample演示了如何使用类似于以下代码的字符串和数值过滤实体:
我对 Java 还很陌生(我的背景是 .NET/C#),但上面说的是有道理的。但是,我不确定如何为日期做类似的事情。来自我的 WCF OData 服务的日期格式为“yyyy-MM-dd'T'HH:mm:ss”。
在此先感谢您的帮助!
sql - 如何存储 TSQL 查询结果以供以后显示
我以前从未使用过 TSQL,但我决定无论如何我都想在 SO数据转储中四处寻找。所以这可能是一个菜鸟问题。我确实尝试搜索答案,但我不知道我正在尝试做什么的技术术语,并且如果您没有正确的关键字,搜索只会很好。
我的目标是找出有多少问题得分为 0,多少问题得分为 1,多少问题得分为 2,等等。我可以写一个查询来找出那些个人计数,没问题。不过,我希望能够运行包含循环的查询。这是我目前使用的:
(编辑:最终目标是从 [0, 3] 扩展到 [-100, 1000] 或解决所有现有问题所需的任何东西)显然,我的问题是我在循环的每个循环中都抓住了计数然后什么也不做。@counter
目前,我得到的结果只是最初设置的计数;迭代次数无关紧要。是否可以将结果存储在某处,然后显示为:
(编辑:任何合理清晰的显示都可以,上表只是一个示例;编辑 2:修改了表格的设计以消除持续的混乱)
如果是这样,这叫什么,它是如何完成的?
.net - 带有反射提供程序的 WCF OData 服务
我们需要为 Activity Feed 提供 API(想想 Facebook),我们决定尝试 OData。我们使用的是 .NET,所以我们选择了 WCF 数据服务,但我们不使用实体框架(或任何其他 ORM),因此我们将使用反射提供程序。因为我们的检索方法有复杂的业务逻辑,所以我们决定将它们公开为服务操作。但是,我们希望将删除/更新和单个实体选择公开为普通的 OData REST 资源。我的问题是我们如何为反射提供者实现一个数据源,它限制对集合的访问但允许访问单个实体(通过键请求),允许 DELETE/PUT/POST 动词,还允许访问单个实体的子集合(即服务/类别(1)/产品)。基本上我只想限制对基本集合的访问(即
c# - 如何使用 linq 对集合对象执行 WHERE(使用 Netflix 数据源)
我正在使用 LinqPad 通过查询 NetFlix OData 源来学习 Linq。
(顺便说一句,我知道他们已经在 SO 上提出了类似的问题……对我没有帮助)。
这是我正在工作的查询,非常棒。
(请原谅所有评论......这证明了我正在试验的事实,并且我将根据各种需求更改查询)。
有两件事我无法弄清楚。
第一的。假设我只想返回前 10 个结果。
第二(也是最重要的)。我想按流派的部分字符串进行过滤。每个标题都包含一个流派集合。我只想显示名称包含某个字符串(如“家庭”)的流派。使用包含“firstFilter”和“secondFilter”的标题更好地过滤。
基本上,我想按流派过滤,但我不知道该怎么做,因为 Title 包含它自己的 Genres 集合,我不知道如何只返回集合中一种或多种流派的标题。
谢谢你的帮助!
ps ...似乎 Netflix OData 源不支持 Any 运算符。
赛斯