activa's blog

.NET, Web, Mobile and more stuff I can't stop talking about

Browsing Posts tagged Nullables

Working with nullable types using reflection is not that hard, but sometimes you have to think about it for a bit or browse the help file before you can actually use it correctly. What I will list here is not rocket science, but it could be helpful to have all the nullable-related stuff in one [...]

We all know the Convert.ChangeType() for changing a value from one (unknown) type to another (unknown) type at runtime, but this method doesn’t handle nullables and enums very well. What may seem a simple task isn’t that simple after all. You have to differentiate nullables, value types and enums. I threw in a little recursion, [...]