From 834e542bc394f3ef3690ab8e2810a7b08c774135 Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Sun, 8 Jul 2018 22:12:08 -0500 Subject: [PATCH] Fixed code error in EF Core post Compiler did not flag an error I had made, until it did... --- source/_posts/2018/f-sharp-options-with-ef-core.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/_posts/2018/f-sharp-options-with-ef-core.md b/source/_posts/2018/f-sharp-options-with-ef-core.md index 84ac2a8..c5c13e8 100644 --- a/source/_posts/2018/f-sharp-options-with-ef-core.md +++ b/source/_posts/2018/f-sharp-options-with-ef-core.md @@ -25,15 +25,15 @@ module Conversion = open System open System.Linq.Expressions - let asLinqExpr<'T> = (LeafExpressionConverter.QuotationToExpression >> unbox>>) - let toOption<'T> = <@ Func<'T, 'T option>(fun (x : 'T) -> match box x with null -> None | _ -> Some x) @> - |> asLinqExpr + |> LeafExpressionConverter.QuotationToExpression + |> unbox>> let fromOption<'T> = <@ Func<'T option, 'T>(fun (x : 'T option) -> match x with Some y -> y | None -> Unchecked.defaultof<'T>) @> - |> asLinqExpr + |> LeafExpressionConverter.QuotationToExpression + |> unbox>> type OptionConverter<'T> () = inherit ValueConverter<'T option, 'T> (Conversion.fromOption, Conversion.toOption)