Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Hour 16. Working with Data > Working with Data from a Service

Working with Data from a Service

Although managing local data is important for many applications, that data typically comes from an external service, such as a web service. In some scenarios, your application will be able to take the results from the service and use them directly; however, in other scenarios, it will be necessary to use a subset of the data returned from the service.

For the examples in this section, the data is returned from a fictitious web server, which returns a list of ServerFavoriteLocation instances, which need to be converted into a FavoriteLocation instance. To do this, you add the following static method to the code in Listing 16.10:

public static FavoriteLocation Convert(ServerFavoriteLocation local)
{
   var newLocation = new FavoriteLocation();
   // Copy all the columns we care about
   return newLocation;
}


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial