Created
May 8, 2017 19:16
-
-
Save daneb/a9a6014c13180b91a9eeb0221fa19a8f to your computer and use it in GitHub Desktop.
F# Listing 35.1
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
#load "Domain.fs" | |
#load "Operations.fs" | |
#r @"C:\Users\Dane Balia\Documents\Visual Studio 2015\Projects\learnfsharp\src\code-listings\lesson-35\packages\FSharp.Data.SqlClient.1.8.2\lib\net40\FSharp.Data.SqlClient.dll" | |
open Capstone6.Operations | |
open Capstone6.Domain | |
open System | |
open FSharp.Data | |
let [<Literal>] Conn = "Name=AccountsDb" | |
type AccountsDb = SqlProgrammabilityProvider<Conn> | |
type GetAccountId = SqlCommandProvider<"SELECT TOP 1 AccountId FROM dbo.Account WHERE Owner = @owner", Conn, SingleRow = true> | |
let accountId : Guid option = GetAccountId.Create(Conn, 100).Execute("tony") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment