This file contains 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
// from http://stackoverflow.com/questions/21194565/null-coalescing-operator-in-f | |
// modified to support DBNull | |
open System | |
let inline isNull value = obj.ReferenceEquals(value, null) | |
let inline isDBNull value = obj.ReferenceEquals(value, DBNull.Value) | |
type NullCoalesce = | |
static member Coalesce(a: 'a option, b: 'a Lazy) = match a with Some a -> a | _ -> b.Value | |
static member Coalesce(a: 'a Nullable, b: 'a Lazy) = if a.HasValue then a.Value else b.Value |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder