Click here to Skip to main content
15,885,686 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 Score

OData 

5 Nov 2018 by Jovan Popovic(MSFT)
Create powerful REST API with just few lines of C# code using MsSql.RestApi package
31 Jan 2018 by Pawel idzikowski
How to replace the web API request query string to provide case insensitive OData search
14 May 2018 by NobsterTheLobster
Consume data from a WCF Data service in a .NET client. MSAL OAuth 2.0
2 Nov 2021 by Herman<T>.Instance
Migrations does not apply to T-SQL rules for ALTER TABLE ALTER COLUMN
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.
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).
31 Aug 2012 by Sandeep Mewara
Here, have a look at this article: MSDN: Slice and Dice OData with the jQuery DataTables Plug-In[^]
18 Oct 2012 by mohsen_alikhani
If you followed this URL : OData support in ASP.NET Web API[]You will see that the MVC 4 Web API version alpha have solution for it but we want supporting it in finalized version !!!
19 Oct 2012 by mohsen_alikhani
The document of the following URL lays out a roadmap for ASP.NET MVC, ASP.NET Web API, and ASP.NET Web Pages : http://aspnetwebstack.codeplex.com/wikipage?title=Roadmap []
31 Oct 2012 by mohsen_alikhani
There is no full support for OData in web app at the moment.
25 Feb 2013 by CodeBlack
Hi,I am currently working on (basically researching) on OData. So I am new to open data protocol. And i want to use this facility with my web api project. As per the requirement i want to fetch the relational data. Basically a data from Parent and Child tables. Everything seems to be...
31 Jul 2013 by nwhitfield
Mobile, geo-centric app for Business Users, Consumers and Sales/Marketing Professionals
10 Jan 2014 by Sampath Lokuge
Firstly, I have to say your security manager is wrong.This is a Myth.There is nothing specific in AJAX. It is just a request performed by your browser. It is just general HTTP request and should be secured as any other HTTP request, regardless its XHR nature.If you maintain proper...
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 =...
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...
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 + "'}", ...
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...
25 Sep 2015 by Rajneesh Kumar Verma
Using OData and WCF Service and visualize result using LinqPad
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[^]
18 Apr 2016 by Shawn1Xu
OData Interoperability with .NET C# and Java applications
13 Jul 2012 by Nunnenkamp
http://crmDoma...
31 Aug 2012 by deepakdynamite
Hello,Is it possible to convert Odata into DataTable and Vice-Versa ?Thanks
3 Sep 2012 by deepakdynamite
i need to change our c# code that reads the datatable in the web service and have it read the odata and convert directly or use as a datatable. i need a datatable provider that uses odata
3 Sep 2012 by Kuthuparakkal
May this help you:Advanced using OData in .NET: WCF Data Services[^]
21 Oct 2012 by VivekUtsa
Hello all,I'm trying to generate a query which will have a inner join between 2 tables, I was able to do that with oData Query generator tool , but was not able to include columns from second table in to the filter I'm putting it more clearly below in SQL terms.Select a.Col1, a.col2,...
21 Oct 2012 by Afzal Shaikh
Query seems correct , Please convert parameter @startdate to appropriate date format like that Convert(DateTime,@startdate,Number).or Try with this Select a.Col1, a.col2, b.col1, b.col2from a inner join bon a.id = b.idwhere a.id = @id and Convert(DateTime,b.startdate,103)=...
30 Oct 2012 by pHiLL87
Hello,is their any documentation to write an own service for the DQS third part reference of the MS SQL 2012 Server yet?I won't use the azure data market so i only need to know how to create a own web service for the reference ("Third Party Reference" in the configuration menu -...
4 Jun 2013 by Syed Taha Tariq Ali
You would need to configure a route to your odata endpoint. This is done inside the App_Start\WebApiConfig.cs file in the Register method. Use the following code to add an entity model and a route:ODataModelBuilder modelBuilder = new...
15 Jul 2013 by indra.217
how to create ODATA Services for Windows Phone 7 in C# in order to use in Windows Phone Emulator?
13 Jan 2014 by Member 10522467
Hello,I have a problem with my wcf data service.When I'm doing a select or an insert, everything is fine.But when I'm try an update or a delete i am refered to my local IP (something like 192.170.1.1).Here is my web.config:
12 Feb 2014 by Mousumi2708
I am using odata controller in mvc.While i am sending json data from ajax post method controller takes null value for properties of class my code like{"Id":"DdZLFwNe7vQ","ExternalInvestorId:"F1/11/Y14","AppKey":"5BB9B50E-AA2C-498B-B895-1E83827CE9F5",}in odatacontroller post...
27 Feb 2014 by Mudita Rathore
See this links i hope this will help you for creating OData support in Web API http://www.c-sharpcorner.com/UploadFile/2b481f/odata-feed-using-Asp-Net-web-api/[^]
28 Feb 2014 by Asif Rehman
$(document).ready(function () { var qry = "Db.svc/CustTypes?select=CustTypeTitle&$format=json"; $('#Makes').autocomplete({ source: qry }); }); 1. I'm unable to extract...
2 Mar 2014 by Jovan Popovic(MSFT)
There is a new connector for jQuery DataTables for OData service. It handles OData services v2, v3, v4. See DataTables OData connector[^]You just need to include the connector js file and setup few parameters in dataTables initialization.
23 Apr 2014 by mekalareddy
I have a query like thisselect * from xxx where dates between '2012-10-26' and '2012-10-27'.and did as URL likeurl/?$filter=dates gt datetime'2012-10-26' and dates lt datetime'2012-10-27'and I am getting response by using this one.Now, I need to get by time, so I changed the URL...
24 Apr 2014 by mekalareddy
this is the solutiondateTimeOffsetValue = year "-" month "-" day "T" hour ":" minute [ ":" second [ "." fractionalSeconds ] ] ( "Z" / sign hour ":" minute )Example: 2000-01-01T16:00:00.000Z
28 Apr 2014 by mekalareddy
I have tables DEPatientVisit and DEPhysiciani need to filter the data based on StimulatorGourpId of DEPatientVisit. what i tried for this...
8 May 2014 by LiQuick
Dear reader,I'm currently trying to access the results of a SAP Gateway ODATA service but one particular method doesn't seem to comply with .net result expectations. The code below is what I'm using and the result is that all the entries are filled with the values of the last entry. LINQPad...
11 May 2014 by LiQuick
Found out what the problem is:There was a KEY defined in the SAP Gateway datamodel, but the returned data didn't contain a key. Somehow the default key was an empty string for each entry, so with the adding of each entry all the data containing the specific key '' would be updated, hence the...
22 May 2014 by Jitendra Sabat
My Angular code goes belowvar data=['asdfgh','fghjkl','qwerty'];return $http.post(url, JSON.stringify(data)).then(function (result) { return result.data; });My web api controller is public class V1MessageController :...
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...
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 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...
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...
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.
21 Aug 2014 by Peter Leow
Refer: odata-support-in-aspnet-web-api[^]
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...
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" ...
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:
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[^]
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...
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 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...
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 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...
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.
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?
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.
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:...
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...
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
4 Dec 2015 by databoom
This tip resolves the problem of Kendo Grid losing the focus after editing in autoSynch mode.
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...
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...
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...
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...
7 Nov 2016 by Richard MacCutchan
Basic Tutorial · OData - the Best Way to REST[^].Introduction to Entity Framework[^].
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...
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.
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 ...
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...
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
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, ...
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
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.
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...
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...
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...
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 [^]
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...
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[^]
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' } ]
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....
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:...
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.
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...
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. ...
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 Richard MacCutchan
You already posted this at Odata - query requests with two contains doent work[^]. Please do not repost the same question.
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 =...
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. ...