The One With

OData Provider for XPO – Client Side

In the previous posts, we have looked at how the WCF Data Service Provider for XPO works and how to expose existing XPO objects as OData. Now let’s take a look at how to consume them.

First, create a service proxy. Let’s use a public OData feed from the DevExpress Channel.

The wizard will generate proxy client side data objects from the OData metadata.

public class Statistics : INotifyPropertyChanged {
    public Guid Oid { get; set; }
    public int CompletedCount { get; set; }
    public int Count { get; set; }
}
public class Video : INotifyPropertyChanged {
    public DateTime Date { get; set; }
    public string Description { get; set; }
    public bool Enabled { get; set; }
    public string Location { get; set; }
    public Guid Oid { get; set; }
    public Statistics Statistics { get; set; }
    public string Title { get; set; }
}
with these we can now make requests like so:

DataContext context 
    = new DataContext(new Uri("http://media.devexpress.com/channel.svc"));
foreach(var video in context.Video) {
    Console.WriteLine(video.Title);
}

What’s Next

Cheers

Azret

Published May 29 2010, 01:16 PM by
Filed under: , ,
Bookmark and Share

Comments

Marcel Malik (IS)

It is possible to use Dev Express FilterControl on client side to filter the WCF Data Services data?

May 29, 2010 4:47 PM

Azret Botash (DevExpress)

Hi Marcel,

Great idea! :) We'll create sample for it... :)

May 29, 2010 5:16 PM

Marcel Malik (IS)

Hurry up ;)

May 29, 2010 5:38 PM

Azret Botash (DevExpress)

Marcel,

Here is a sample :)

May 29, 2010 8:11 PM
LIVE CHAT

Chat is one of the many ways you can contact members of the DevExpress Team.
We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.

If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

FOLLOW US

DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

Copyright © 1998-2017 Developer Express Inc.
All trademarks or registered trademarks are property of their respective owners