Click here to Skip to main content
15,891,688 members
Everything / OData

OData

OData

Great Reads

by Jovan Popovic(MSFT)
Create powerful REST API with just few lines of C# code using MsSql.RestApi package
by Pawel idzikowski
How to replace the web API request query string to provide case insensitive OData search
by NobsterTheLobster
Consume data from a WCF Data service in a .NET client. MSAL OAuth 2.0
by Herman.Instance
Migrations does not apply to T-SQL rules for ALTER TABLE ALTER COLUMN

Latest Articles

by Herman.Instance
Migrations does not apply to T-SQL rules for ALTER TABLE ALTER COLUMN
by Sunny Makode
This is an introductory article about creating an Odata Rest API in collaboration with Entity Framework. We are also going to use Autofac as our IOC container. Also, Repository and Unit of Work pattern will be used for cleaner access of persistence model through our ORM (Entity Framework).
by Jeremy Likness
Build data-driven .NET applications with seamless client-server communication using fluent C# LINQ over OData (like GraphQL but without the JSON).
by Jovan Popovic(MSFT)
Create powerful REST API with just few lines of C# code using MsSql.RestApi package

All Articles

Sort by Updated

OData 

21 Dec 2022 by Madhushanka Chithrananda
I have to read invoice line items. To Read all invoices • projection/v1/InvoiceHandling.svc This would list all the invoices in all company registered in cloud(Only Header Info) To Read exact invoice •...
21 Dec 2022 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...
12 Aug 2022 by Member 15090354
Hi Team, I am using Odata in our application due to that i am not able to call web api methods in Postman or web browser Could you please suggest how to create web api methods same as normal web api methods [EnableQuery] public...
10 Jun 2022 by kmoorevs
I have the following request that gives me the data that I need. The problem I am having is that I need the Quantity summed and grouped by the remaining columns/objects. I have removed the html encoding to improve readability. ...
10 Jun 2022 by rnbergren
The vendor will have to setup the odata feed for you I think. I don't know of any way off the top of my head to do this. I would probably reach out to the vendor and ask. Or I would download the subset without any filtering etc.. and then group...
2 Nov 2021 by Herman<T>.Instance
Migrations does not apply to T-SQL rules for ALTER TABLE ALTER COLUMN
20 Jul 2021 by Member 11030334
I wrote an HTTPClient (.NET Core 3.x) that returns a JSON string but when I try to Deserialize it I run into issues. Issues ranging from can not deserialize array to string or the results are null. The string itself I can view on a Quick Watch...
20 Jul 2021 by Member 11030334
SOLVED I did not want to work with an OData Json object, so I had to strip the OData header and the rest just looked like a collection of JSON docs content = httpResponse.Content.ReadAsStringAsync().Result; var outer =...
7 Jan 2021 by Member 10870320
Please find the below query that we are sending from the from fe (react ) when we are trying to search with two text boxes .It doesnt return any result. However an oData query with two dropdowns / onetextbox and one dropdown works/single...
6 Jan 2021 by Member 10870320
The full URL is https://localhost:3333/OverviewItem?$count=true&$filter=(contains(name1,'seek') and contains(name2,'aron') &$orderby=name1 desc,name2 desc &$skip=0&$top=10 Even i removed after the $ part still same issue then we find that...
6 Jan 2021 by Richard MacCutchan
You already posted this at Odata - query requests with two contains doent work[^]. Please do not repost the same question.
24 Jul 2020 by Herman<T>.Instance
Hi Folks, I have a Stored Procedure that retrieves with dynamic column names the results from parameters with dynamic parameter names. In SSMS I see the correct result. I have to expose this DataSet via Entity Framework in my OData Controller. ...
26 Mar 2020 by clemenslinders
HI Richard, Thanks for your input. But I received the solution from Gert. For deletion I do not have to pass the E-tag, but I can pass the primary key. Although using the Soap web service I do pass the E-tag. It works when I changed my code...
26 Mar 2020 by clemenslinders
LS, In D365BC I created a simple table, card page and list page. You can create a list of workers entering: first name, last name and function. I turned the card page into a web service and now there is a ODATA V3, ODATA V4 and SOAP web service...
26 Mar 2020 by Richard MacCutchan
The 404 message tells you that the page was not found, so you need to check the URL. If it is correct then you will need to debug the server code to see why it raises that error.
13 Mar 2020 by Herman<T>.Instance
Hi friends, Struggling with OData V4 when calling a Function. My Client sends to the service: http://wrk2198:80/services/ProjectUsedModels(modelNumber='10000') The webapi service expects:...
11 Feb 2020 by Herman<T>.Instance
Hi All, I have created a WEBAPI (ASP.NET and using Microsoft.AspNet.OData packages to have a V4 version of OData. In my own defined OData Controllers (based on stored procedures exposed via Entity Framework) I have Get Methods to retrieve data....
8 Dec 2019 by Sunny Makode
This is an introductory article about creating an Odata Rest API in collaboration with Entity Framework. We are also going to use Autofac as our IOC container. Also, Repository and Unit of Work pattern will be used for cleaner access of persistence model through our ORM (Entity Framework).
30 Nov 2019 by Asif Rehman
This is working fine. public IHttpActionResult Post(Categories categories) { //... } But When I change Categories to Categories[] to received multiple records from javascript client, it show null object. public IHttpActionResult Post(Categories[] categories) { //... } from postman...
30 Nov 2019 by Ashutosh Gpt
create another class contains list of Categories public class CategoriesList { IList ListItem; } public IHttpActionResult Post(CategoriesList categories) { //... } body may something like this: ListItem : [ { id: 1, Category: 'Value1' }, { id: 2, Category: 'Value2' } ]
21 Nov 2019 by Jeremy Likness
Build data-driven .NET applications with seamless client-server communication using fluent C# LINQ over OData (like GraphQL but without the JSON).
1 Oct 2019 by Maciej Los
If i understand you well, you're talking about data pagination... Check this out: Paging with ASP.NET Web API OData – Youssef M's Blog[^]
1 Oct 2019 by User 14447995
hello, I want to filter the record from Record_1 To Record_100 or whatever the range we want but without primary key or without using any column name. I'm using odata C#. Is it possible and how? Thanks What I have tried: I have tried but with primary key and i want without primary key. what...
1 Oct 2019 by OriginalGriff
Quote: I want to filter the record ... without primary key or without using any column name. You do realize that that request is just nonsense, don't you? You have a set of values in a table that you which to filter down to: in your case "Record_1" to "Record_100" which means that you have to...
22 Aug 2019 by User 14447995
I've two parameters like Register No. and UserName. I Entered Register No. Like "###$$$$%%%%" and UserName Like "TESTPC\TEMP" than result is successful but no record shown. Instead of above if I Entered. Like UserName. I Entered Register No. Like "###$$$$%%%%" and UserName Like "TESTPC\TEMP"...
22 Aug 2019 by BillWoodruff
Use Swashbuckle.OData to generate Swagger: [^] also see: [^] Why not try Swagger support: [^] Are you sure Swagger supports OData: see [^] and [^]
18 Feb 2019 by LiQuick
Dear readers, For a project I need to expose a third party API partly to the public. To do this I thought I could easily get in incoming request, reroute it to the API, get response back and deliver response to the client. Pretty simple concept in theory, but somehow problematic. Partly the...
18 Feb 2019 by Derek Viljoen
Run Postman against your service API and see what it gives you. Try to duplicate exactly what your proxy is generating (look specifically at the HTTP headers). You can verify this in Fiddler. Are you sending content-type, and if so what is it set to? Are you sending an 'accept' header in the...
5 Nov 2018 by Jovan Popovic(MSFT)
Create powerful REST API with just few lines of C# code using MsSql.RestApi package
17 Aug 2018 by Dave Kreskowiak
You never gave any details about your database schema as coded in EF, so this is just a guess. What you're seeing is the expected behavior. You are NOT supposed to make any changes to a column tagged [Timestamp] in EF. Timestamp fields are entirely managed by EF. They are used to manage...
17 Aug 2018 by Herman<T>.Instance
Hi Folks, in my ODATA service I use EF6 to work with SQL Server. An EDMX is created also for the table Departments. In that table there is a TimeStamp field for Concurrency purposes. And yes I have added [Timestamp] data annotation in the code. And in the EDMX the field is FIXED for Concurrency...
13 Aug 2018 by Mike V Baker
As it turns out the call to odata was just fine, it was the syntax of the listitems that was wrong { data && { function(data) ( // PAREN HERE ) // AND HERE } } Switched the braces out and put in parens instead.
13 Aug 2018 by Mike V Baker
I'm working on a react-native prototype and trying to introduce react-odata. https://www.npmjs.com/package/react-odata has the following sample code in the readme file: const baseUrl = 'http://services.odata.org/V4/TripPinService/People'; const query = { filter: { FirstName: 'Russell' } }; ...
13 Aug 2018 by Mike V Baker
So it turns out that it was just a problem of using braces {} where I should have used parens () render() { return ( { this.state && this.state.products &&...
13 Aug 2018 by Mike V Baker
I learning react-native. I'm trying to display a really simple list of products from a database call. The data is loading but for some reason the individual items are not being loaded into the list. What I have tried: import React, { Component } from 'react'; import { Text, View, ...
15 May 2018 by NobsterTheLobster
Publish a WCF DataService with entity model, updatable views, filtering and authentication
14 May 2018 by NobsterTheLobster
Consume data from a WCF Data service in a .NET client. MSAL OAuth 2.0
31 Jan 2018 by Pawel idzikowski
How to replace the web API request query string to provide case insensitive OData search
7 Sep 2017 by Herman<T>.Instance
Hi everyone, In my organisation we have a WPF application that connects to an ODATA layer. That layer connects to the database. The database is in a cluster. I was wondering who has experience with such a setup as described. What reactions can I expect in the ODATA layer and in the WPF...
21 Aug 2017 by NaVeN Kumar
Hi, I would like to filter the records based on child table data using odata query. Example I have tables like below. Employee contains empId and Name, EmployeeText is having empId, languageid and Text Employees EmpId Name 1 Test 2 Test2 EmployeeText empId LanguageId Text 1 ...
10 Feb 2017 by Jerod Johnson
Use the CData Software API Server to create an OData service for your databases and build a dynamic Web app based on the database data.
28 Nov 2016 by Neal Pandey
This article is a tutorial on creating a basic OData (Open Data Protocol) endpoint for a MongoDB database using MEAN stack.
14 Nov 2016 by Pabbock
Hello everybody,I'd been trying to find a way to get the info from the last month on of an OData Feed. I know how to get it if a write the specific date but I need the expression to detect by itself the last month of the actual month we are.What I have tried:So far I have this...
7 Nov 2016 by Member 8233601
Its really confusing to find difference between odata and entity framework. can anyone help me out to clear this difference and basic concept behind odata.What I have tried:I tried to google it but didn't get any clear picture.
7 Nov 2016 by Richard MacCutchan
Basic Tutorial · OData - the Best Way to REST[^].Introduction to Entity Framework[^].
25 Jul 2016 by sunset747
Referring this question: I want to start to write my Web API Services with ODataControllers in the future, but I am still facing a question I could not answer with Google:All the oData Examples I found on the internet (for instance ODataSamples) are accessing the DBContext object directly...
8 Jul 2016 by ARIA 5
I have posted a question about Entity framework 6+ and WCF Data ServiceConsuming WCF Data Service EF , Failed to SaveChange()please someone tell me what I am wrong about them.Any help would be truly appreciated,Thanks in advance.What I have tried:I have tried to create a...
18 Apr 2016 by Shawn1Xu
OData Interoperability with .NET C# and Java applications
1 Apr 2016 by Akhil Mittal
This is the last article of the RESTful series in which I’ll explain how you can leverage OData capabilities in ASP.NET WebAPI. I’ll explain what OData is and we’ll create OData enabled RESTful services.
1 Mar 2016 by Akhil Mittal
This article will explain how to make WebAPI secure using Basic Authentication and Token based authorization.
18 Feb 2016 by Md Shohel Rana
I have a question about EF(Entity Framework)If I have a database that allows the users to add columns and/or tables with columns ( no deletions ) as well as schemas at run time can the EF handle these modifications to the underlying data store without much tweaking or is this asking too...
18 Feb 2016 by Dave Kreskowiak
You're asking WAY too much of EF. If this was a requirement (change the DB schema on-the-fly) EF should never have been used.
14 Feb 2016 by Abhinav S
There is no need for System.web in ASP.Net 5.You need to use .Net core instead.Alternately, switch back to version 4.5.2.References - ScottGu's Blog - Introducing ASP.NET 5[^].Top 10 Changes in ASP.NET 5 and MVC 6 | Stephen Walther[^]
14 Feb 2016 by Member 11915386
I'm trying to port a Web API I wrote in ASP.Net 4.5.2 to ASP.Net 5 for the cross platform support, which turns out to be a critical issue. In my former web api I implemented an OData solution, but when trying to port my web api to ASP.Net 5 I was unable to use System.Web let alone...
10 Feb 2016 by Siddharth R Barman
Quick introduction to oData (v4) by understanding how to implement CRUD method using ASP.NET Web API
13 Jan 2016 by NaVeN Kumar
Hi All,I am very new to OData service. I have created a WebAPi Odata Service with Entity Framework. I am able to get the data from service using HttpClient. I am trying to pass id value to find a record. I am not sure how to pass value to service.Below is my code:public string...
29 Dec 2015 by databoom
This tip is about how to tune up the Kendo Grid when using its authentication feature.
4 Dec 2015 by databoom
This tip resolves the problem of Kendo Grid losing the focus after editing in autoSynch mode.
6 Oct 2015 by rdamske
I am using OData/EF6 and I have coded up my ChangeInterceptors. I was wondering if I need to do something to ensure that two users do not step on each other if both happen to execute the same ChangeInterceptor at the same time. I cannot find anything either way about this.Russ
29 Sep 2015 by Deepak_ker
Hi,Currently I am facing some issues while querying the oData services. I am very new to oData query syntax.I am trying to query oData service using the following urlhttps://mysite/DataQueryGroups?$select=Id,Name&$filter=IsHidden eq false&IsShared ne...
25 Sep 2015 by Rajneesh Kumar Verma
Using OData and WCF Service and visualize result using LinqPad
14 Sep 2015 by Rahul Rajat Singh
For those who are still doing old school REST, a pointer in the direction of ODATA
6 Sep 2015 by basitsar
Dear,I have created data services, below is my login code working fine.var _url = "http://localhost/CMWeb/DataService.svc/Users?$filter=UserName eq '" + "Basit" + "' and Password eq '" + "s" + "'&$format=json"; UserAdmin = 0, $.ajax({ type:...
31 Aug 2015 by Member 11949649
I dnt understand the problem is wether it from my code or in iis server,this is email-rupi2009@gmail.complease give me the solution.
24 Aug 2015 by JimShelley
A simple example of a SharePoint Add-In using the REST API and the Cross Domain library
13 Aug 2015 by OriginalGriff
Provided that the links to your site are to the database download itself only, it probably wouldn't be a problem. But...it would be better to add the database as a zipped download to the article itself, so it is hosted here. That way, if your site is down for any reason the article isn't broken...
10 Aug 2015 by Member 11898286
please tell me any solution.i follow some link but not get right way.http://stackoverflow.com/questions/23288237/visual-studio-2013-server-explorer-custom-data-provider-mongodb" target="_blank" title="New Window">^]
6 Aug 2015 by Member 9844487
I have two table Documents & Pageswith foreign key relationshipwhen i am using query in my WEB API../odata/Documents?$expand=Pagesin odata Results its returning---> [Docid=1,Name="My Doc",...,Pages=null]Why it's returning null value instead of expanding Page properties?
17 Jul 2015 by Anil Vaghasiya
var _url = "http://localhost:49497/DataService.svc/Mst_User?$filter=Us_Name eq 'Basit' and Us_Password eq 's'&$format=json"; $.ajax({ type: "POST", data: "{ strFUserName: '" + VariableUsername + "', strFPassword: '" + Variablepassword + "'}", ...
16 Jul 2015 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
I suggest you to...Store hashed password in database instead of plain text.Make that service HTTPS enabled so that connection will be secure.
16 Jul 2015 by basitsar
Dear,I created OData Services with Custom Authentication, How to pass the UserName & Password in Ajax. Note that without having security below code working fine.Please help on thisBelow is my Code var _url = "http://localhost:49497/DataService.svc/Mst_User?$filter=Us_Name eq...
27 Jun 2015 by nonenameroot
Hello,I am trying to develop a solution based on a sql server database, entity framework and wcf (OData). I secure my data seen so how do use the sql server security levels (access rights and roles) or use wcf authentication, I'm really perturbed.Thank you in advance.
18 Jun 2015 by F-ES Sitecore
Yeah, you definitely want to stay clear of Windows Authentication, it's so insecure...with knowledge like that I can tell you're a *nix man :) You should use usernames and passwords instead, that's way more...
18 Jun 2015 by Sergey Alexandrovich Kryukov
Of course you can use authentication based on user/password registered in the service itself, as well as user certificates.Please start here: https://msdn.microsoft.com/en-us/library/ff405740.aspx[^].—SA
18 Jun 2015 by Member 8353523
Is there any way to secure a WCF Data Service using User and Pass or Certificate? I am not interested in windows authentication as it is very insecure and let's say my client is running on Linux so it will be totally useless. I also CAN'T use cookies.
12 Jun 2015 by SM-2015
I am new to the MVVM pattern and WCF Data Services so please bear with me. I am trying to create a solution with a WCF DataServices project (I have followed https://msdn.microsoft.com/en-us/library/dd728275(v=vs.110).aspx for the DataService as a guide).I then want to consume the service...
12 May 2015 by hypermellow
Hi,I've not used the DataTables API (like you posted above), but if you are looking to search a specific column then I would do it like://Global variable for DataTable ... var dt;//Create your DataTable ... function createDataTable(){ dt =...
12 May 2015 by Member 10503105
I am using DataTables[^] to draw my data. Also I am using OData filter to show only those rows which I need, by several conditions.var dtApi = new $.fn.dataTable.Api("#CardsGrid_grid");...filter assing (for example: "Status eq 0" and...)...dtApi.draw();It works fine. I am receiving...
11 May 2015 by VishyBond007
Hi,You need to create web API and host it locally or IIS.The using the HTTP client pass the parameter in JSON form to the service.See the below link.https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh781239.aspx[^]
11 May 2015 by jayarajlcc
Dear TechiesI am new to WPF , Asp.net Web API , REST and OData. I need to work in a project where WPF is the client (MVVM) that utilizes RESTful services hosted on a Web server (Using Asp.net Web API) communicating using OData. Would any one be kind enough to provide me a very small sample...
4 May 2015 by Member 11662814
How Do i read the Odata standard $ count value in the java when Consuming through the Rest Template.1.I am hitting the service through Rest template Url Example:
16 Feb 2015 by Jeroen E
There were two problems with this as it turns out:First:My web.config was not properly set up to handle a dot in the URL.So I changed it to this: verb="*" type="System.Web.Handlers.TransferRequestHandler" ...
10 Feb 2015 by Jeroen E
From an MVVM application I get the following URL for delete: http://localhost/Recruiters/Addresses(guid '7777-777')/CIP.Domain.AddressesI did not fill complete guid in the example URL, but it is a valid one.This URL is not a normal OData route, so I created an routing...
14 Jan 2015 by anurag9179
Hello,I am working project server 2013. I am facing some issues regarding In-built report in Project server/ SharePoint 2013. When I open In-Built report, specially Project Overview dashboard reports which uses oData Connection and i think the oData connection may be the cause of this issue,...
4 Nov 2014 by Jeroen E
Hello,I have a database containing 2 tables:- recruiters- AddressesThese tables have a n:m relationship.I connect with the database through an OData api.I'm trying to get the addresses of a specific recruiter but can't get it to work.What I've tried is:var...
3 Nov 2014 by Jeroen E
I figured it out after I came across this link http://stackoverflow.com/questions/2247051/how-to-use-selectmany-with-dataservicequery[^]I turned the query around by first querying and filtering the recruiters and then the addresses.The query ended up like this:var addressesQuerry =...
1 Sep 2014 by zolea
I'm still struggling with this. Does anyone have a hint please?Thanks.
21 Aug 2014 by Peter Leow
Refer: odata-support-in-aspnet-web-api[^]
21 Aug 2014 by sam3440
AS a beginner I want to become familiar with using oData protocol in WebApi. Can any one recommend good book for oData services using WebApi.Should I definitely install webTools to use Web API 2.2 Much Appreciated, Thanks.
14 Aug 2014 by zolea
Hi,I am trying to find the best way to pass exceptions or messages from my Odata Service back to an Odata web forms client.On the service, when I call this controller:public async Task Post(Products product){ var message = "Product with id = not found"; throw new...
5 Aug 2014 by Yogesh Vardhmane
Hi,I am trying to consume WCF Odata Service in BreezeController. I need to set Metadata for BreezeController. But I am not able to fetch Metadata through WCF Odata Service.I am not very sure on why Breezecontroller needs Metadata.Note:- I am using EntityFramework in my Odata...
15 Jun 2014 by wujapan
Hi i'm trying to post model to a web api where every time only one item in the model shown up at post method. like if i'm posting a model called Movie ,Id and Title are the properties of this model.so here my problem is when i'm trying to post it from client side using knockout.js,only Title...
5 Jun 2014 by Suvabrata Roy
Ok, Now I assume that its a database near about 5 GB and increment on regular basis about 0.09%.I also assume that its reside on remote that mean two databases cant talk directly.Few prerequisites :Each Table you need to synchronize they should have one primary key.Using...