Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Windows Phone 7.5 Data Cookbook

You're reading from   Windows Phone 7.5 Data Cookbook Over 30 recipes for storing, managing, and manipulating data in Windows Phone 7.5 Mango applications.

Arrow left icon
Product type Paperback
Published in Oct 2011
Publisher Packt
ISBN-13 9781849691222
Length 224 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Ramesh Thalli Ramesh Thalli
Author Profile Icon Ramesh Thalli
Ramesh Thalli
Arrow right icon
View More author details
Toc

CRUD operations with OData


In this recipe we will discuss how to implement create, update, and delete operations, also known as CRUD operations using DataServiceCollection and Context class. Here are the mappings for HTTP Verb to OData operation:

HTTP

OData

GET

Read

POST

Update

PUT

Insert

DELETE

Delete

Getting ready

For this sample, we will be using the editable OData API exposed by odata.org. Just a note, at the time of writing the book this service was provided for testing OData edit features with some restrictions.

You can browse OData using http://services.odata.org/(S(bltvbobia1rthiavqczdcr1u))/OData/OData.svc/. We will be using this link to consume the data in this recipe. For simplicity, we shall only update the categories.

How to do it...

To consume sample editable OData, we first need to generate the proxy class using the DataSvcUtil using the following command-line:

datasvcutil /uri:http://services.odata.org/(S(bltvbobia1rthiavqczdcr1u))/OData/OData.svc/ /out:.\EditODataModel...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image