Search code examples
f#type-providers

which library is GetSamples in


Referenced here

Add calculated key to collection

not in FSharp.Data 2.4.6

and no name space referenced in the Answer given by the great TP

GetSample is present.....


Solution

  • GetSamples can be used on your JSON data represented by a JsonProvider. Install the FSharp.Data Nuget package and add the import declaration by using open FSharp.Data. Once you have defined a JSON file or some JSON data you should be able to process it further.

    open FSharp.Data
    
    //type Values = JsonProvider<"yourData.json">
    type Values = JsonProvider<""" [{"Name":"Hello"}, {"Name":"World"}] """>
    printfn "%A" (Values.GetSamples())