SHARE
TWEET

Untitled

a guest Aug 21st, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. type Confidence =
  2.     | Low
  3.     | Medium
  4.     | High
  5.  
  6. type Goal = {
  7.     Confidence: Confidence
  8.     ...
  9.  }
  10.      
  11. type UnionHandler<'T>() =
  12.        inherit SqlMapper.TypeHandler<'T>()
  13.  
  14.        override __.SetValue(param, value) =
  15.             param.Value <- value.ToString()
  16.             ()  
  17.  
  18.        override x.Parse(value: obj) =
  19.             Union.parse <| string value
  20.  
  21.  
  22. let registerTypeHandlers() =
  23.     SqlMapper.AddTypeHandler (UnionHandler<Confidence>())
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top