Blogs

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 Azret Botash (DevExpress)
Filed under: , ,
Technorati tags: XPO, OData, WCF Data Services
Bookmark and Share

Comments

 

Marcel Malik (IS) said:

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) said:

Hi Marcel,

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

May 29, 2010 5:16 PM
 

Marcel Malik (IS) said:

Hurry up ;)

May 29, 2010 5:38 PM
 

Azret Botash (DevExpress) said:

Marcel,

Here is a sample :)

May 29, 2010 8:11 PM
More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.