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