Questions tagged [odata-v4]

The Open Data Protocol (OData) is a standardized protocol for building REST APIs. OData v4 specifies many best practices for REST APIs including a terse, hypermedia-oriented JSON format.

OData v4 is an OASIS Standard, with more than 20 companies participating on the technical committee. Microsoft, SAP, Salesforce, and many other companies are strong advocates of the protocol as a solution to an otherwise fragmented REST API landscape.

This same standardization allows generic hypermedia clients to consume the service. Excel, Tableau, and QlikView are well known data clients that have support for consuming OData.

167 questions
6
votes
4 answers

OData v4 Function always returns 404

Trying to move from OData v3 to OData v4. Why do I keep getting a 404 when trying to use OData Functions? Web API Config: ODataModelBuilder builder = new…
Matt
  • 6,787
  • 11
  • 65
  • 112
6
votes
3 answers

Difference between PageSize and MaxTop

What's the difference between [EnableQuery(PageSize=20)] and [EnableQuery(MaxTop=20)]? As far as I can tell they both set a max limit on the result. Calling GET odata/Products?$top=100 on either of them both give me only 20 results.
Snæbjørn
  • 10,322
  • 14
  • 65
  • 124
6
votes
2 answers

Get the OData catalog for Web API OData v4 in XML

I am trying to get a Web API OData V4 endpoint up and running. I got it going finally (after removing all the DateTime properties from my endpoint) and now the listing of the entities is in JSON. I love JSON, but I use LinqPad to test my endpoints. …
Vaccano
  • 78,325
  • 149
  • 468
  • 850
5
votes
1 answer

Does Odata adaptor support "Patch" request with "$expand" query during CRUD operations?

I have a component with ODataAdaptor as a data source, now i would like to make a Patch request with $expand query like i make for GET request(since GET request openly supports $expand query). But i don't have an idea whether it is accepted or is…
Logesh
  • 51
  • 2
5
votes
2 answers

OData service with multiple routes while using unbound functions

Does anyone know how to get OData v4 hosted in a .NET service to work with multiple routes? I have the following: config.MapODataServiceRoute("test1", "test1", GetEdmModelTest1()); config.MapODataServiceRoute("test2", "test2",…
goroth
  • 2,510
  • 5
  • 35
  • 66
5
votes
2 answers

GROUP BY / Case Insensitivity extension for Asp.Net Web API ODATA?

Couldn't find a group by references in ODATA V4 documentation. When we pass the group by query in URL it just returns the key, not the actual grouped results. Any references for using Group by in Asp.Net ODATA, on extensibility points of ODATA…
Abhijeet
  • 13,562
  • 26
  • 94
  • 175
5
votes
1 answer

Cannot return object

I want to return this object by finding it by it's name: public class Product { public int Id { get; set; } public string Name { get; set; } public decimal Price { get; set; } public string Category { get; set; } } The controller…
Simon Linder
  • 3,378
  • 4
  • 32
  • 49
4
votes
1 answer

Bi-directional navigation in OData V4

* I will accept the answer with bounty if it just solves my problem (if you don't have a detailed canonical solution) * When i try to access the metadata from browser (http://......Service.svc/$metadata), I see below error. 500 Cannot find…
Gana
  • 482
  • 3
  • 11
  • 32
4
votes
1 answer

Syntax for Aggregating a Filtered Dataset in OData v4 Spec using $apply

Suppose I am querying a dataset called Sales with the following schema: id (int) price (decimal) active (bit) Using the $apply query option and the aggregate transformation of the OData v4 spec, what would be the syntax for finding the average price…
Ken
  • 1,830
  • 3
  • 20
  • 32
4
votes
1 answer

Unable to cast object of type 'Microsoft.OData.Edm.Csdl.CsdlSemantics.UnresolvedType' to type 'Microsoft.OData.Edm.IEdmCollectionType'

In Visual Studio 2013 I'm consuming an OData V4 endpoint using OData Client Code Generator found in Nuget. Unexpectedly this week the t4 template gave the error: Unable to cast object of type 'Microsoft.OData.Edm.Csdl.CsdlSemantics.UnresolvedType'…
Pynt
  • 2,023
  • 2
  • 20
  • 26
4
votes
2 answers

OData V4 Client Code Generator and handling a 401 response

I have a WebAPI 2.2 w/ OData V4 service that uses a custom authentication mechanism. Basically it's similar to OAuth's Bearer authentication such that a request is made to a specific endpoint with the username and password and a token is returned.…
MHollis
  • 1,449
  • 9
  • 23
4
votes
1 answer

Suffix ".svc" on url for odata service

This might be a stupid question, I have just a little confusion on the suffix .svc on ODATA service, since most of examples I see always have suffix .svc at root URL, example: http://services.odata.org/V4/Northwind/Northwind.svc/ Or even on ODATA…
cuongle
  • 74,024
  • 28
  • 151
  • 206
4
votes
1 answer

Web API 2.2 - OData v4 ODataQueryOptions.applyTo() returning null when $select or $expand present?

I have setup a Web API 2.2 ODataController such that I can process my OData options manually (i.e. Without [EnableQuery] and or using a ODataQueryOptions parameter). However I have run into what looks like a bug. Given the following code: public…
Xorcist
  • 3,129
  • 3
  • 21
  • 47
4
votes
1 answer

How to call an OData function/action generated by a OData client generator?

Linked to my other question, if I have an OData function with the following definitions builder.EntitySet("Ent"); var companyActionConfig =…
Veksi
  • 3,556
  • 3
  • 30
  • 69
3
votes
1 answer

How to POST OData entity and link it to multiple existing entities at the same time?

How do I post an entity to an OData endpoint while at the same time associating it with other existing entities in the body? Consider the following class structure (sample): class Invoice { public int Id { get; set; } public Person Issuer…
julealgon
  • 7,072
  • 3
  • 32
  • 77
1
2
3
11 12