This example illustrates how to use stored procedures with OData. You can learn how to map an entity to a stored procedure in this blog: Stored Procedures in the Entity Framework. This blog describes how to expose a stored procedure in the OData service: oData and Stored Procedures aka Service Operations. We suggest that you use the DevExtreme WCF OData Service project template when creating the OData service.
To execute a web method of the OData service, use the ODataStore.get method. For example:
[JScript]store.get("TestOperation", { param1: 123, param2: "abc"}).done(...);
Here is a good blog describing how to configure the method so it supports the JSON format: Creating a .NET WCF 4.0 JSON Service.
Question Comments
Added By: Enderson Salas at: 8/25/2014 9:23:07 AM
Can I use this to a stored procedure with a insert?
Added By: Marion (DevExpress Support) at: 8/26/2014 2:26:39 AMHello Enderson,
To process your recent post more efficiently, I created a separate ticket on your behalf: T144008: OData service - How to use a stored procedure to insert data. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
CustOrderHist_Result Where is this defined ? Thanks
Added By: Uriah (DevExpress Support) at: 12/29/2014 12:33:27 AMHello Chandru,
To process your recent post more efficiently, I created a separate ticket on your behalf: T191552: Where is defined CustOrderHist_Result class?. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
Hi
In below example in dataservice.svc.cs file there is only get method.can u suggest me how to handle update and delete record ?
Added By: Nikolai (DevExpress Support) at: 5/18/2015 1:58:20 AM Hi Kulasekaran,Please refer to the ASP.NET WebAPI vs WCF OData ticket where we discussed a similar issue.Added By: York Leung at: 8/10/2015 11:06:28 AM
Hi,
can you tell me how to do the group on cust-order-hist.dxview dxList by ProductName , how to group the dataSource on cust-order-hist.js?
Added By: Marion (DevExpress Support) at: 8/11/2015 1:17:44 AM@York,
To process your recent post more efficiently, I created a separate ticket on your behalf: T276861: dxList - How to group data. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
I have a question. Do i have to generate manually a cust-order-hist-view-model.js or I can generate automaticly
Added By: Marion (DevExpress Support) at: 11/2/2015 9:52:50 PM@Yoaldis,
To process your recent post more efficiently, I created a separate ticket on your behalf: T307194: OData service - How to use stored procedures - How to create a View. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.