Hi all:
Just wondering if there is any best practice for DAL to represent null value (from a nullable column).
We currently have our own in-house DAL and are representing null value with int.MinValue. However, this rise concerns with developers thinking that when comparing values, we are purposely imposing another "added" value onto int.MinValue and the fact that int.MinValue is used for null value in a DAL layer is confusing. So other come up with the NullValue from .net 2.0, but we found out that there are performance and syntax issue related to this approach too:
- zorched.net: .NET Nullable Types and DBNull Expose Design Flaws
- BCL Team Blog: Nullable Performance
- megasolutions.net: Webservice with optional parameters
- dotnet2themax.com: Inconsistent behavior of C# nullable types
So, what's your take in this? How does other well-known ORM take care of null values? Is there even a best practice around this issue?