Inconsistencies in the .NET Enum class

During a recent project of mine, I had to do a lot of enum manipulation using the .NET Enum class and I have to say I wasn’t impressed. Besides the shortcoming of it not being a generic class (and thus not being especially type-safe), Enum also has some strange inconsistencies in terms of how it handles matched integral types.

Read more »

How to put spaces in your NHibernate enums

NHibernate lets you map C# enums to database columns. This can be quite convenient in cases where you have a database column for something like gender. To map them, you follow the procedure outlined here.

That works all fine and dandy, as long as the strings you want to store in the database are valid C# identifiers.

Read more »