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)