OData Programming Cookbook for .NET Developers - Juntao Cheng - E-Book

OData Programming Cookbook for .NET Developers E-Book

Juntao Cheng

0,0
39,59 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Odata (Open Data Protocol) is a Web protocol for querying and updating data that provides a way to unlock your data and free it from silos that exist in applications today. OData enables data access among a variety of applications, services, and stores by adopting existing Web technologies such as HTTP, XML, and JSON. This book deals with common OData programming cases over the Microsoft .NET Framework platform and eases the learning curve for a .NET developer to start incorporating OData in data service development.This book provides a collection of recipes that help .NET developers to get familiar with OData programming in a quick and efficient manner. The recipes cover most OData features from the former ADO.NET Data Service to the current WCF Data Service platform. In addition, all the sample cases here are based on real-world scenarios and issues that .NET developers might come across when programming with OData in application development.This book will be your handy guide with basic to advanced walkthroughs of common OData programming cases for the Microsoft .NET Framework platform. You will learn quick solutions to necessary tasks to integrate the power of OData at both server-side and client-side.This book will help you master the use of OData with .NET Framework by taking you through hands-on and practical recipes. It starts by talking about the common means for building OData services and consuming OData services in client applications. Then, some more specific topics like hosting, configuration and security are discussed. The book also covers many popular and interesting topics such as integrating OData in web applications, and developing data-driven mobile applications with OData. Moreover, you can also find quite a few recipes discussing real-world OData producers and new features in latest and future versions.Within "OData Programming Cookbook for .NET Developers", all the recipes are selected based on real-world scenarios that you will commonly come across. Each recipe covers a specific topic, going from the description of the problem, through a conceptual solution, to a solution containing sample code. By following these recipes, you can acquire how to program with OData in a simple, effective, and easy manner.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 329

Veröffentlichungsjahr: 2012

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

OData Programming Cookbook for .NET Developers
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Instant Updates on New Packt Books
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Building OData Services
Introduction
Building an OData service via WCF Data Service and ADO.NET Entity Framework
Getting ready
How to do it...
How it works...
See also
Building an OData service with WCF Data Service and LINQ to SQL
Getting ready
How to do it...
How it works...
There's more...
See also
Exposing OData endpoints from WCF RIA Service
Getting ready
How to do it...
How it works...
See also
Adding custom operations on OData service
Getting ready
How to do it...
How it works...
See also
Exposing database stored procedures in WCF Data Service
Getting ready
How to do it...
How it works...
See also
Using custom data objects as the data source of WCF Data Service
Getting ready
How to do it...
How it works...
There's more...
See also
Using Interceptors to customize a WCF Data Service
Getting ready
How to do it...
How it works...
There's more...
See also
Accessing ASP.NET context data in WCF Data Service
Getting ready
How to do it...
How it works...
See also
Creating a custom WCF Data Service provider
Getting ready
How to do it...
How it works...
There's more...
See also
2. Working with OData at Client Side
Introduction
Exploring an OData service through web browser
Getting ready
How to do it...
How it works...
There's more...
See also
Using Visual Studio to generate strong-typed OData client proxy
Getting ready
How to do it...
How it works...
See also
Generating OData client proxy via DataSvcUtil.exe tool
Getting ready
How to do it...
How it works...
There's more...
See also
Editing and deleting data through WCF Data Service client library
Getting ready
How to do it...
How it works...
See also
Accessing OData service via WebRequest class
Getting ready
How to do it...
How it works...
There's more...
See also
Executing OData queries in an asynchronous manner
Getting ready
How to do it...
How it works...
There's more...
See also
Filtering OData query results by using query options
Getting ready
How to do it...
How it works...
There's more...
See also
Dealing with server-side paged entity sets from WCF Data Service
Getting ready
How to do it...
How it works...
See also
Performing WPF data binding with OData service data
Getting ready
How to do it...
How it works...
See also
Injecting custom HTTP headers in OData requests
Getting ready
How to do it...
How it works...
See also
Consuming HTTP compression enabled OData service
Getting ready
How to do it...
How it works...
See also
Using MSXML to consume OData service in unmanaged applications
Getting ready
How to do it...
How it works...
See also
3. OData Service Hosting and Configuration
Introduction
Hosting a WCF Data Service in IIS server
Getting ready
How to do it...
How it works...
See also
Hosting a WCF Data Service in Console application
Getting ready
How to do it...
How it works...
See also
Deploying a WCF Data Service on Windows Azure host
Getting ready
How to do it...
How it works...
There's more...
See also
Configuring WCF Data Service to return error details
Getting ready
How to do it...
How it works...
See also
Configuring WCF Data Service to return JSON-format response
Getting ready
How to do it...
How it works...
See also
Applying basic access rules on WCF Data Service
Getting ready
How to do it...
How it works...
There's more...
See also
Getting rid of .svc extension by using ASP.NET URL Routing
Getting ready
How to do it...
How it works...
See also
Enabling dynamic compression for OData service hosted in IIS 7
Getting ready
How to do it...
How it works...
There's more...
See also
4. Using OData in Web Application
Introduction
Building data-driven ASP.NET Web Form pages with OData
Getting ready
How to do it...
How it works...
See also
Adopting OData in ASP.NET MVC web applications
Getting ready
How to do it...
How it works...
See also
Building ASP.NET Page UI with OData and XSLT
Getting ready
How to do it...
How it works...
There's more...
See also
Building AJAX style data-driven web pages with jQuery
Getting ready
How to do it...
How it works...
There's more...
See also
Consuming OData service with datajs script library
Getting ready
How to do it...
How it works...
See also
Using OData service in Silverlight data access application
Getting ready
How to do it...
How it works...
There's more...
See also
Consuming WCF Data Service in PHP pages
Getting ready
How to do it...
How it works...
There's more...
See also
5. OData on Mobile Devices
Introduction
Accessing OData service with OData WP7 client library
Getting ready
How to do it...
How it works...
There's more...
See also
Consuming JSON-format OData service without OData WP7 client library
Getting ready
How to do it...
How it works...
See also
Creating Panorama-style, data-driven Windows Phone applications with OData
Getting ready
How to do it...
How it works...
See also
Using HTML5 and OData to build native Windows Phone application
Getting ready
How to do it...
How it works...
There's more...
See also
Accessing WCF Data Service in Android mobile application
Getting ready
How to do it...
How it works...
There's more...
See also
Accessing WCF Data Service in iOS application
Getting ready
How to do it...
How it works...
See also
6. Working with Public OData Producers
Introduction
Getting started with Netflix OData online catalog
Getting ready
How to do it...
How it works...
See also
Manipulating Sharepoint 2010 documents through OData endpoint
Getting ready
How to do it...
How it works...
There's more...
See also
Using OData protocol for Windows Azure Table storage access
Getting ready
How to do it...
How it works...
There's more...
See also
Query StackOverflow forums data with OData endpoint
Getting ready
How to do it...
How it works...
There's more...
See also
Tracking information of NuGet packages through OData feeds
Getting ready
How to do it...
How it works...
See also
Exploring eBay online products catalog through OData service
Getting ready
How to do it...
How it works...
See also
Consuming SSRS 2008 R2 report through OData feed
Getting ready
How to do it...
How it works...
There's more...
See also
7. Working with Security
Introduction
Applying Windows authentication for OData service
Getting ready
How to do it...
How it works...
There's more...
See also
Using ASP.NET Forms authentication to secure OData service
Getting ready
How to do it...
How it works...
There's more...
See also
Securing OData service with HTTPS transport
Getting ready
How to do it...
How it works...
See also
Implementing OData service authentication with custom HTTP Module
Getting ready
How to do it...
How it works...
There's more...
See also
Adding custom authorization with server-side processing pipeline
Getting ready
How to do it...
How it works...
See also
Using Interceptors to control access for individual entity set
Getting ready
How to do it...
How it works...
See also
Implementing role-based security for OData service
Getting ready
How to do it...
How it works...
There's more...
See also
8. Other OData Programming Tips
Introduction
Using LINQPad to compose OData query code
Getting ready
How to do it...
How it works...
See also
Exploring OData service with ODataExplorer
Getting ready
How to do it...
How it works...
There's more...
See also
Using OData service in Windows PowerShell script
Getting ready
How to do it...
How it works...
See also
Exploring OData service with Microsoft Excel PowerPivot component
Getting ready
How to do it...
How it works...
There's more...
See also
Inspecting OData HTTP traffic through Fiddler web debugger
Getting ready
How to do it...
How it works...
See also
Using Open Data Protocol Visualizer to inspect the object model of OData service
Getting ready
How to do it...
How it works...
See also
Consuming OData service in Windows 8 Metro style application
Getting ready
How to do it...
How it works...
There's more...
See also
9. New Features of WCF Data Service 5.0 (OData V3)
Introduction
Upgrading existing OData service to WCF Data Service 5.0
Getting ready
How to do it...
How it works...
There's more...
See also
Using geospatial types in OData service
Getting ready
How to do it...
How it works...
There's more...
See also
Using Any and All operators to filter OData entities
Getting ready
How to do it...
How it works...
There's more...
See also
Updating OData entities through HTTP PATCH requests
Getting ready
How to do it...
How it works...
See also
Resolving base URI of OData entity sets dynamically
Getting ready
How to do it...
How it works...
See also
Exposing binary data on OData entity with Named Resource Stream
Getting ready
How to do it...
How it works...
See also
Extending OData service functionalities with Service Actions
Getting ready
How to do it...
How it works...
There's more...
See also
Index

OData Programming Cookbook for .NET Developers

OData Programming Cookbook for .NET Developers

Copyright © 2012 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: July 2012

Production Reference: 1180712

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-849685-92-4

www.packtpub.com

Cover Image by Sandeep Babu (<[email protected]>)

Credits

Author

Steven Cheng

Reviewers

Shayne Burgess

Ibrahim Sukru

Acquisition Editor

Dhwani Devater

Lead Technical Editor

Kedar Bhat

Technical Editors

Veronica Fernandes

Manasi Poonthottam

Zinal Shah

Copy Editors

Brandt D'Mello

Laxmi Subramanian

Project Coordinator

Joel Goveya

Proofreader

Ting Baker

Indexer

Tejal R. Soni

Graphics

Valentina D'silva

Manu Joseph

Production Coordinator

Arvindkumar Gupta

Cover Work

Arvindkumar Gupta

About the Author

Steven Cheng is a Senior Support Engineer at Microsoft CSS, China. He has been supporting Microsoft development products and technologies for more than seven years. He is also working actively in the Microsoft MSDN forum community.

His technical specialties have covered many popular Microsoft development technologies including .NET Framework, ASP.NET, XML WebService, Windows Communication Foundation, Silverlight, Windows Azure, and Windows Phone. His technical blog can be found at http://blogs.msdn.com/stcheng.

In 2010, he wrote the book Microsoft Windows Communication Foundation 4.0 Cookbook for Developing SOA Applications, Packt Publishing.

The publication of this book could not have been possible without the efforts put in by a large number of individuals. I would like to thank my colleagues Shayne Burgess, Yi-lun Luo, and Mog Liang who have given me lots of ideas and suggestions on the book recipes. And thanks goes to my friends Jasmine Gong and Le Fei who have helped me a lot during the entire book authoring lifecycle.

Most importantly, none of this would have been possible without the love and patience of my family. I would like to express my heartfelt gratitude to my family.

Lastly, I offer my regards and blessings to all of those who supported me in any respect during the completion of this book.

About the Reviewers

Shayne Burgess is a Program Manager on the SQL Server engineering team at Microsoft. He has worked on the OData team at Microsoft for the past four years, contributing to the definition of the OData protocol and building Microsoft implementations of OData.

Ibrahim Sukru is a Software Engineer from Istanbul. He is the founder of xomila.com. He developed several RESTful web services with ASP.NET MVC, OData, and WCF. He loves web standards and technologies, HTML, CSS, and Microformats and enjoys contributing to open source software and coffee.

www.PacktPub.com

Support files, eBooks, discount offers and more

You might want to visit www.PacktPub.com for support files and downloads related to your book.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

http://PacktLib.PacktPub.com

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.

Why Subscribe?

Fully searchable across every book published by PacktCopy and paste, print and bookmark contentOn demand and accessible via web browser

Free Access for Packt account holders

If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.

Instant Updates on New Packt Books

Get notified! Find out when new books are published by following @PacktEnterprise on Twitter, or the Packt Enterprise Facebook page.

Preface

OData (Open Data Protocol) is a web protocol for querying and updating data, which can be freely incorporated in various kind of data access applications. OData makes it quite simple and flexible to use by applying and building upon existing well-defined technologies such as HTTP, XML, AtomPub, and JSON.

WCF Data Services (formerly known as ADO.NET Data Services) is a well-encapsulated component for creating OData services based on the Microsoft .NET Framework platform. It also provides a client library with which you can easily build client applications that consume OData services. In addition to WCF Data Services, there are many other components or libraries, which make OData completely available to the non-.NET or even non-Microsoft world.

This book provides a collection of recipes that help .NET developers to become familiar with OData programming in a quick and efficient way. The recipes have covered most OData features from the former ADO.NET Data Services to the current WCF Data Services platform. In addition, all the sample cases here are based on real-world scenarios and issues that .NET developers might come across when programming with OData in application development.

What this book covers

Chapter 1, Building OData Services, introduces how we can use WCF Data Services to create OData services based on various kind of data sources such as ADO.NET Entity Framework, LINQ to SQL, and custom data objects.

Chapter 2, Working with OData at Client Side, shows how to consume OData services in client applications. This will cover how we can use strong-typed client proxy, WebRequest class, and unmanaged code to access OData services. You will also learn how to use OData query options, asynchronous query methods, and other client-side OData programming features.

Chapter 3, OData Service Hosting and Configuration, discusses some typical OData service hosting scenarios including IIS hosting, custom .NET application hosting, and Windows Azure cloud hosting. This chapter also covers some service configuration scenarios such as applying basic access rules, exposing error details, and enabling HTTP compression.

Chapter 4, Using OData in Web Application, talks about how to take advantage of OData services for developing various data-driven web applications including ASP.NET Web Form application, ASP.NET MVC application, Silverlight web application, AJAX style web application, and PHP web application.

Chapter 5, OData on Mobile Devices, demonstrates how to use OData services in mobile application development. Recipes in this chapter will cover the most popular mobile device platforms including iOS, Android, and Windows Phone 7.

Chapter 6, Working with Public OData Producers, introduces some existing public products and services, which have adopted OData for exposing application data. The recipes in this chapter will demonstrate how to create client applications to consume data from these public OData producers.

Chapter 7, Working with Security, discusses some common and easy-to-use means for securing OData services. Topics covered in this chapter include applying Windows authentication, applying ASP.NET Forms authentication, using HTTPS transport, and implementing custom authentication/authorization code logic.

Chapter 8, Other OData Programming Tips, explores some trivial but useful OData programming topics. You will learn how to use some existing tools for testing and debugging OData services. This chapter also demonstrates how to consume OData services in Windows PowerShell scripts and Windows 8 Metro style applications.

Chapter 9, New Features of WCF Data Service 5.0 (OData V3), demonstrates some of the new features introduced in WCF Data Service 5.0 (OData V3). The new features covered in this chapter include geospatial types, "Any" and "All" query operators, Dynamic entity set URI resolving, Named Resource Stream, and custom Service Actions.

What you need for this book

All the recipes in this book are based on the .NET C# programming language. However, you don't have to be a very experienced C# Developer. In order to follow the recipes and run the corresponding sample code, you need a test environment with the following items:

A development machine with Windows 7 or Windows Server 2008 OSVisual Studio 2010 Professional or Ultimate edition (with SP1)SQL Server 2005 (or 2008) Developer (or Expression) edition with Northwind sample database installedIIS 7.x (for Windows 7 or Windows 2008)IE 9 web browserFiddler web debugger

For other software or components required by some specific recipes, they will be listed as prerequisites in the Getting ready section of the relevant recipe.

Who this book is for

If you are a .NET Developer and you want to learn how to use OData in real-world data access application development using a quick and efficient approach, then this book is for you. With this book you will be able to find quick and handy solutions for various kind of OData programming scenarios using Microsoft .NET Framework. To follow the recipes, you will need to be comfortable with .NET Framework, Visual Studio IDE, C# programming language, and the basics of web programming such as HTTP, XML, and JSON.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title through the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website, or added to any list of existing errata, under the Errata section of that title.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at <[email protected]> with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.

Chapter 1. Building OData Services

In this chapter we will cover:

Building an OData service via WCF Data Service and ADO.NET Entity FrameworkBuilding an OData service with WCF Data Service and LINQ to SQLExposing OData endpoints from WCF RIA ServiceAdding custom operations on OData serviceExposing database stored procedures in WCF Data ServiceUsing custom data objects as the data source of WCF Data ServiceUsing Interceptors to customize a WCF Data ServiceAccessing ASP.NET context data in WCF Data ServiceCreating a custom WCF Data Service provider

Introduction

Open Data Protocol (OData) is a web protocol for querying and updating data, which can be freely incorporated in various kinds of data access applications. OData makes itself quite simple and flexible to use by applying and building upon existing well-defined technologies, such as HTTP, XML, AtomPub, and JSON.

WCF Data Service is the main component for building OData service on .NET Framework platform. WCF Data Service supports exposing various data source models such as ADO.NET Entity Framework, LINQ to SQL, and CLR Objects through OData service endpoints. Also, we're not limited to these existing data models, we can build our own custom Data Service Provider or convert other services (such as WCF RIA service) to OData service. In this chapter, we will demonstrate several cases of using WCF Data Service to build OData services that can deal with different kinds of data source models.

Exposing OData endpoints from WCF RIA Service

WCF RIA Service is one of the great extension components based on the standard WCF service. WCF RIA Service is designed for building data access services (for n-tier solutions), which will not only expose data sets to clients but also encapsulate most of the business/application logics at service layer. With the latest WCF RIA Service version, we can make a WCF RIA Service expose data through various kinds of endpoints such as SOAP, OData, and JSON.

In this recipe, we will show you how to open an OData endpoint from an existing WCF RIA Service.

Getting ready

To play with WCF RIA Service, we need to install Visual Studio 2010 Service Pack 1, which includes the runtime and development tools for WCF RIA Service V1 SP1.

Visual Studio 2010 Service Pack 1 is available at http://support.microsoft.com/kb/983509.

The source code for this recipe can be found in the \ch01\ODataRIAServiceSln\ directory.

How to do it...

Create a new ASP.NET Empty Web Application.Create the ADO.NET Entity Framework data model from the sample database.

The following screenshot shows the class diagram of the data model created from the Northwind sample database (four tables are included):

Create a new WCF RIA Service by using the Domain Service Class item template in Visual Studio (see the following screenshot).Specify the service options (especially the one for enabling an OData endpoint) in the Add New Domain Service Class dialog (see the following screenshot).

The following are all the options we need to set for a new WCF RIA Service:

Domain Service Class name: This is the type name of our RIA service class.Available DataContext/ObjectContext classes: This is the data model class we will use for providing the underlying data objects. Make sure we have saved all items in the project so that the ADO.NET Entity Framework data model class will appear in the drop-down list.Enable client access and Expose OData endpoint options: As the name explains, these two options will enable the RIA service to be accessed from client applications and also add an additional endpoint on it so as to expose data entities in an OData compatible format.
Create a .svc file as the service access endpoint for the WCF RIA Service.

In the .svc file, we need to specify the ServiceHostFactory and Service types through the @ServiceHost directive (see the following code snippet).

<%@ ServiceHost Language="C#" Debug="true" Service="ODataRIAService.NWDomainService" Factory="System.ServiceModel.DomainServices.Hosting.DomainServiceHostFactory, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>

As shown in the previous @ServiceHost directive, we need to supply the full name (including namespace and assembly name) of the ServiceHostFactory type in the Factory attribute.

Tip

If you use the WCF service item template to create a new .svc file, Visual Studio will generate the ServiceContract and Service implementation code files automatically. To prevent this, you can create a Text or XML file instead and manually change the file extension to .svc (and adjust the file content correspondingly).

Launch the WCF RIA Service and access its OData endpoint by adding the odata/ suffix to the URL.

By adding the odata/ suffix to the URL over the base service address, we can reach the OData endpoint exposed by the WCF RIA Service. The default output of the OData endpoint is just the same as a standard WCF Data Service (see the following screenshot).

How it works...

When creating the sample WCF RIA Service, we enable the OData endpoint on it by selecting the Expose OData endpoint option in the Add New Domain Service Class dialog. Actually, we can find the magic behind the dialog within the web.config file (see the following configuration fragment).

The dialog adds a domainServices/endpoints/add element in the<system.serviceModel> section. This element tells the runtime to add a new endpoint for each WCF RIA Service and this endpoint will generate an OData format response (by using the System.ServiceModel.DomainServices.Hosting.ODataEndpointFactory type).

Likewise, if you have some existing WCF RIA Services, which were created without the OData endpoints enabled, we can simply make them OData enabled by adding the previous configuration settings manually in the web.config file.

See also

Building an OData service via WCF Data Service and ADO.NET Entity Framework recipe

Exposing database stored procedures in WCF Data Service