My problem is I have an existing table that I can not modify that contains fields that are nullable.
I have a model that I do not want nullable properties.
What I want to do is have a convention (I presume this is how) where I can set the default value to use based on the models property type when DBNull is encountered from the database.
- ints/double = 0
- string = ""
- bool = false
Pretty sure this was simple to do in NHibernate but I can't find out how to do this in EF.
I am using the latest EF package from nuget which I believe is EF 4.2.