But .NET 2 does. The fact that by simply adding a single question mark ‘?’ on each datatype is enough to do the magic.
Right now I have to browse to all the generated classes and change every single datatype to its nullable counterpart. This is very painful. Now imagine if I have to regenerate the classes again due to some database schema changes or anything, I will have to redo all over again.
Is there a way to automate this? Or at least make it an option during the NHibernate class generation to use appropriate nullable datatype for every nullable column in the database.
I am sure it is very easy to do. But then again I am not the developer so I can only guess.
How does everyone else doing this? I am curious. Right now I am noticing that if I dont use nullable types, every int column in my database will become 0 if I dont assign any value, which is not really what I want. For date, it throws date overflow exception since Date.MinValue in .NET and in database is not identical.
Once I put a ‘?’ on these datatypes, everything work wonderfully and exactly as I expect.
After a discussion, we decide to support this. But this will not be available in the current version. Do you want to try this as soon as possible? If yes, I will send you an early access release once it is ready.
You are welcome. Thank you so much for your valuable suggestion. In fact, this fix is ready in Service Pack 2. Do you need it now? If yes, I can arrange an early access release for you.
Just a note to inform you that Service Pack 2 is released. You are suggested to run the product updater inside the bin folder of VP Suite installation folder to advance to the latest release.
Please feel free to let me know if there are any questions.