O'Reilly logo

Mastering F# by Suhaib Fahad, Alfonso García-Caro Núñez

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

OData type provider

OData is an open data protocol to allow the creation and consumption of queryable and interoperable REST APIs so we can interact with a data source through the Internet using simple HTTP requests, almost as if it were a local database. We will use the OData type provider to first explore the OData data from a particular source.

Prerequisites

We will set up our F# script file by referencing the proper OData and type provider assemblies:

  1. Create an F# script file, ODataTypeProviderSample.fsx.
  2. Add related references to the script file:
            #r "FSharp.Data.TypeProviders" 
            #r "System.Data.Services.Client.dll" 
     
            open System 
            open System.Linq 
            open System.Data 
            open Microsoft.FSharp.Data.TypeProviders 
    

Using the type provider

For this sample, we ...

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