Partners:
Valdis Iļjučonoks
Technical Fellow, Software Architect
Visual Studio ALM evangelist
Microsoft MVP
http://www.tech-fellow.net | @tech_fellow
Geta AS, Tech Fellow Consulting, Latvian .Net UG
valdis.iljuconoks@outlook.com
Loving data with F#
Valdis Iļjučonoks
There are three kinds of lies: lies,
damned lies, and statistics.

-- Benjamin Disraeli
Information rich programming
Bring data source closer to program
Barrier to include data sources:
 Need to represent data as types, properties and methods
 Generated code must be replaced every time service reference is adjusted
Type Providers
From 1k feet:
 Compile-time type provider
 Erased or generated types approach
 Data set schema as type info source
Driven by F# team and community
DbmlFile
EdmxFile
ODataService
SqlDataConnection
SqlEntityConnection
WsdlService
AppSettings
Excel
Graph
Machine
Management
Math
Regex
Xaml
Xrm
Apiary
Csv
Freebase
Json
WorldBank
Xml
DGML
Word
Csv
DataStore
Hadoop/Hive/Hdfs
HelloWorld
Management
MiniCvs
Xrm
FunScript
…
{Demo image}
Json Provider
WorldBank Provider
Xml Provider
OData Service Provider
Is it worth to develop custom provider?
 Is schema available?
 Will provider have enough usage it’s worthwhile to write?
 Will schema change during coding?
 Will it change during program execution?
Authoring TypeProvider
 Uses F# Code Quotations
 AddMember()
 AddMemberDelayed()
let t = ProvidedTypeDefinition(thisAssembly,namespaceName,
"Type" + string n,
baseType = Some typeof<obj>)

let staticProp = ProvidedProperty(propertyName = "StaticProperty",
propertyType = typeof<string>,
IsStatic = true,
GetterCode = (fun args -> <@@ "Hello!" @@>))

staticProp.AddXmlDocDelayed(fun () -> "This is a static property")
t.AddMember staticProp
Type Providers
Bring data source closer to program
Feedback

  
Partners:

Loving data with F#