Last active
November 14, 2018 13:39
-
-
Save rexcfnghk/64364c05362b9dbaf1dd466b207a6aee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module CompositionRoot | |
let findPlayerNames' = | |
findPlayerNames "Data Source=localhost; Initial Catalog=MyDb; Integrated Security = True" | |
module Program | |
let main _ = | |
// Database queried once | |
let playerNames1 = findPlayerNames' () |> Seq.toList | |
// Database queried once again | |
// Same connection string is used due to closure created | |
// The function findPlayerNames is 'partially applied' | |
let playerNames2 = findPlayerNames' () |> Seq.toList | |
0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment