c# - fluent nHibernate map YesNo when column is nullable -


i'm using fluent nhibernate map a database flag column "y"/"n" bool property:

map(x => x.enabled).column("enabled_flag").customtype("yesno"); 

the question is, how 1 specify how map null? null mapped true, false, exception?

update

the default settings seems map null false. that, still wondering how override true?

if want change functionality of null case have create own custom type - derive iusertype.

i have done similar dates (where 0 date of 01-01-0001 cant save mssql) , guids want insert null instead of guid.empty)

creating own user type gives ability override nullsafeset , nullsafeget methods - want (change handling of nulls @ read or write) might able inherit original yesno type

a example http://lostechies.com/rayhouston/2008/03/23/mapping-strings-to-booleans-using-nhibernate-s-iusertype/


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -