odata

How to filter oData call using dynamic date?

这一生的挚爱 提交于 2019-12-11 11:40:27
问题 I'm making an AJAX call using URL as follows. http://somecomputer/Service.svc/Method?$filter=SomeDate gt DateTime'2014-08-24' This works perfectly and and the moment, I generate the string describing the date right before my AJAX call. However, I wonder if it's possible to match the date on dynamic values, such as today or lastyear or what not. I haven't found any documentation of that when googling so probably it's not possible but I still need to check with the wisdom of SO. 回答1: Yes, it is

how to increase return records size odata service from client side?

只愿长相守 提交于 2019-12-11 11:21:58
问题 I have wcf odata service return me some records, but when it records are returned it returns some limited number of records (100). I searched the web and found that there are some configuration parameters set in service initialization. MaxResultSetsPerCollection SetEntitySetPageSize Reference But is it possible to override these from the client side, when the service is consumed. if so how to do it. I want to set records returned to be 1000 instead of 100 回答1: No, you cannot increase the

Filter and collections in OData

徘徊边缘 提交于 2019-12-11 11:21:51
问题 This is related to Azure's recently launched search service that is currently in preview form. I'm trying to figure out how to use OData's filter with collections. I know that I can do this: $filter=Products/any(p: p eq 'WidgetA') which will filter the Products collection by WidgetA. What I am trying to figure out is how to specify WidgetA OR WidgetB. I know that I can do this: $filter=Products/any(p: p eq 'WidgetA') or Products/any(p: p eq 'WidgetB') but thought there must be a more elegant

Generating OData $metadata with the schema http://schemas.microsoft.com/ado/2007/06/edmx

半城伤御伤魂 提交于 2019-12-11 11:15:59
问题 When I use ODataLib 5.6.1 to generate an OData metadata document like this: var eModel = new Microsoft.Data.Edm.Library.EdmModel(); .... ...WriteMetadataDocument() .... I get the following xml: edmx document 1 : <edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx" Version="3.0"> ... </edmx:Edmx> However this metadata (http://services.odata.org/V3/OData/OData.svc/$metadata) has a different schema: edmx document 2 : <edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2007

如何在SAP Cloud Platform上进行第一个integration flow开发

做~自己de王妃 提交于 2019-12-11 10:29:22
登录SAP Cloud Platform integration tenant,点击Edit图标: 创建一个新的Content package: 保存content package后,点击artifacts标签页,此处创建integration flow: 点击Add,选择integration flow: 保存: 然后就可以进行iFlow的编辑了: 创建sender channel:把integration flow切换成编辑模式,点击这个箭头,把它拖到Start图片位置: Adapter类型选择HTTPS: 维护Address: 选择message converter: json to xml converter: 选中后放到integration process方框内,看到一条绿色的线: 再选择Content Modifier: 拖到integration process里: 选择call->external call: 将External Call的request reply同Receiver建立连接,adapter类型选择OData V2: 选择这个OData V2 adapter,在connection标签页的Address字段里,维护这个地址: https://espmrefapps.hana.ondemand.com/espm-cloud-web/espm.svc

Dynamics CRM OData query filtering on expanded attributes only works if no results come out?

故事扮演 提交于 2019-12-11 10:12:33
问题 I have a requirement to fetch Price List Item records which adhere to the following requirements: Filter by a specific PriceList Filter by a specific currency Filter by the Name of the related Product containing a given string I got the first two points working no problem, but it feels like expanding doesn't cope well with filtering. I started from a "straight" query on Product entity: .../ProductSet?$filter=substringof('sometext', Name) Equivalent SQL (targeting the corresponding CRM

ASP.NET allow anonymous access to OData $metadata when site has global AuthorizeAttribute

眉间皱痕 提交于 2019-12-11 10:05:47
问题 I have an ASP.NET OData site that has the following in the WebApiConfig file: config.Filters.Add(new AuthorizeAttribute()) This forces all callers to authenticate before calling any of the controllers. Unfortunately, this also forces user authentication to access the "$metadata" url. I need to globally force authentication for all controller access while also allowing anonymous access the the "$metadata" url. 回答1: Create a custom filter that derives from AuthorizeAttribute and override the

Wcf Web API filter by DateTimeOffset

送分小仙女□ 提交于 2019-12-11 09:22:20
问题 I am currently using WCF Web API Preview 5 and am trying to filter a list of users where the LastModifiedDate is greater than or equal to the provided datetimeoffset: http://api.myapp.com/users?$filter=LastModifiedDate ge datetimeoffset'2011-06-01T14:03:00+00:00Z' However all I am getting is an error saying: Microsoft.ApplicationServer.Query.ParseException: '.' or '(' expected (at index 34) The filtering seems to be working fine as this filter returns the requested user http://api.myapp.com

Update resources through navigation properties possible?

白昼怎懂夜的黑 提交于 2019-12-11 09:08:38
问题 I have a resource A that has a navigation property that points to resource B. The schema looks like this: Resource A: ID B (this is a one-to-many navigation property) Resource B: ID Property1 Property2 Can I update values of resource B (i.e. update property1 and property2 of B) through the navigation link of A? In other words, can I say A.B[5].Property1 = x? In the OData spec and examples, I only see descriptions of modifying which instance of B is associated with A (i.e. modifying /A(0)/

OData filter nested query

那年仲夏 提交于 2019-12-11 08:48:27
问题 Let's assume we have an employee json resultset and assigned reviewer (as nested json resultset) available. I would like to find out case where a reviewer is assigned/and reviewer not assigned to the employee. By using the query below I was able to get assigned reviewer. $filter=Reviewer/any(reviewer: reviewer/ReviewerId gt 0) This returns all employees where reviewer is available. But how do I return result where reviewer is unavailable (or empty)? Thanks. 回答1: If you're looking to get all