O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating an OData Wrapper

The previous section looked at querying an OData service using the OData model class. Although accessing the OData service model classes directly from a viewmodel is possible, it can make unit testing difficult because it relies on the actual OData producer.

In the sample for this chapter, an intermediary class called EbayClient performs all OData queries. EbayClient implements the custom IEbayClient interface, shown in the following excerpt:

public interface IEbayClient{    void SearchItemsAsync(string query,                          int beginIndex = 0, int maxItems = 0);    event EventHandler<SearchItemsCompleteEventArgs> SearchItemsComplete;}

By using the IEbayClient interface and not ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required