Skip to content

Instantly share code, notes, and snippets.

@avegaraju
Last active December 23, 2018 22:55
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save avegaraju/e27a7abe2645023078015666fdf07b49 to your computer and use it in GitHub Desktop.
open System.Data.SqlClient
[<EntryPoint>]
let main argv =
let getDbConnection() =
let connection = new SqlConnection("a_real_sql_connection_string")
connection.Open()
connection
let getAllProducts() =
DB.allProducts (getDbConnection())
|> fun x -> match x with
| Ok p-> p|> Seq.toList
| Error e -> List.Empty
let tryUpdateProductDimensions (productId: int)=
getAllProducts()
|> fun products -> UpdateProductDimensions.find (productId, products)
|> fun product -> UpdateProductDimensions.update product
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment