Questions tagged [odata]

The Open Data Protocol (OData) is a standardized protocol for building REST APIs. OData specifies many best practices for REST APIs, including a terse, hypermedia-oriented JSON format. Use this tag for all specification versions (v2, v3, v4.x).

The Open Data Protocol (OData) is a standardized protocol for building REST APIs. It is a web protocol for querying and updating data, which can be freely incorporated in various kinds of data access applications

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. , and are well known data clients that have support for consuming OData.

7563 questions
17
votes
3 answers

Visual Studio 2017 Localization Publish Settings

This should be simple, but I haven't found a way to make this stop happening. Visual Studio publishes a lot of localized DLLs - It appears there is German localization, Spanish localization, Italian localization, french localization, Japanese…
Jordan
  • 2,992
  • 2
  • 20
  • 29
17
votes
1 answer

Odata v4 error "Does not support untyped value in non-open type"

As I updated the model, it throws "Does not support untyped value in non-open type". It was working before the update. Unable to pin down the source of the problem. any ideas.
vijay daniel
  • 183
  • 1
  • 1
  • 5
17
votes
3 answers

OData Url Length Limitations

Browsers have limitation on the length of the URLs. IE has limitation that Url length should not exceed 2K characters. When I form a $filter equals query, I could compare with multiple input values. In such a case the length of the Url would exceed…
Venki
  • 2,129
  • 6
  • 32
  • 54
17
votes
6 answers

Using enums in WCF Data Services

I'm trying to manually build a WCF Data Service using a POCO data model and I cannot figure out how to properly expose enum values. Assuming a simple model like: public class Order { public int ID {get; set;} public string Description {get;…
Todd
  • 5,538
  • 1
  • 31
  • 34
17
votes
6 answers

How do I map an OData query against a DTO to another entity?

My question is very similar to this one: How do I map an OData query against a DTO to an EF entity? I have a simple setup to test the ASP.NET Web API OData V4 $filter functionality. What I would like to do is to “alias” some properties of the…
niklr
  • 1,671
  • 3
  • 24
  • 40
17
votes
4 answers

How to parse OData $filter with regular expression in C#?

Hi I'm wondering what the best approach would be to parse an OData $filter string in C#, for example /API/organisations?$filter="name eq 'Facebook' or name eq 'Twitter' and subscribers gt '30'" Should return all organisations with a name of Facebook…
Nick Spicer
  • 2,279
  • 3
  • 21
  • 26
17
votes
2 answers

How to address entity that uses composite identity key in OData Url?

I have an entity OrderItem that has OrderId and ProductId integer fields and these two fields form the identity key/primary key for this table. I would like to use OData/Web API to expose such entities through a service and to be able to select…
ViktorZ
  • 901
  • 1
  • 10
  • 26
16
votes
2 answers

Enable WCF Data Service to accept/return JSON by default

I have a WCF Data Service that I'd like to return JSON by default for all operations. Is there a place I can set that in configuration/via service attributes?
Irwin
  • 12,551
  • 11
  • 67
  • 97
16
votes
1 answer

Cannot use 'Microsoft.AspNet.OData.Routing.ODataRoute' with Endpoint Routing.' Exception with ASP Net Core 2.2

After upgrading the ASP NET Web API project framework to the Core 2.2 version, the OData route configuration fails. It throws "Cannot use 'Microsoft.AspNet.OData.Routing.ODataRoute' with Endpoint Routing." Exception. The link…
Oscar Llop
  • 191
  • 1
  • 4
16
votes
2 answers

Why is Entity Framework generating the following nested SQL for Azure Mobile Services Table Controllers

I'm trying to get to the bottom of an entity Framework issue when using it with a TableController I've created the following setup. The basic TodoItem example provided with a new Mobile Web API which leverages EntityFramework, TableController & the…
Eoin Campbell
  • 43,500
  • 17
  • 101
  • 157
16
votes
1 answer

How to expose Azure Sql Server database using OData

Is there a way to create a Azure Sql Database and then expose it as a rest API so you may call restful calls to CRUD tables with OData?
foluis
  • 988
  • 2
  • 10
  • 23
16
votes
3 answers

OData Support in ASP.net core

Is oData supported now in ASP.netcore now that version 1 has been released? I have searched, but I could not find anything that says one way or the other.
Greg Gum
  • 33,478
  • 39
  • 162
  • 233
16
votes
4 answers

OData and WebAPI: Navigation property not present on model

I'm trying to put together a simple toy project using Entity Framework, WebAPI, OData, and an Angular client. Everything is working fine, except the navigation property that I have put on one of my models doesn't seem to be working. When I call my…
MWinstead
  • 1,265
  • 6
  • 12
  • 27
16
votes
1 answer

Does OData query support nested filters with AND/OR operators?

Does OData query support nested filters with AND/OR operators? By nested query, I mean query similar to this: ((FieldA < 50 OR FieldA > 100) AND FieldB == "MyString") I am building an OData query editor control, so I need to know if these are…
RainCast
  • 4,134
  • 7
  • 33
  • 47
16
votes
2 answers

OData JSON camelCase

I want to use the CamelCasePropertyNamesContractResolver for the OData JSON response. How can I achieve this. With the follwoing Code Fragment only the webapi calls are considered. regards WebApiConfig.cs public static class WebApiConfig { …
Marko
  • 1,291
  • 1
  • 21
  • 37