O'Reilly logo

Mastering Xamarin.Forms by Ed Snider

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 API Data Service

Using BaseHttpService as a foundation that abstracts away the HTTP request details, we can now begin to create services that leverage it to get responses back from the API in the form of domain-specific models. Specifically, we will create a data service that can be used by the ViewModels to get the TripLogEntry objects from the backend service.

We will start off by defining an interface for the data service that can be injected into the ViewModels, ensuring there is no strict dependency on the API or the logic that communicates with it, continuing the pattern we put in place in Chapter 4, Platform Specific Services and Dependency Injection.

  1. Create a new interface named ITripLogDataService in the Services folder in the ...

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