In on of my projects I had make an interface between database and web service in C# code.
One of problem I had to face was need to cast strings to enumerable types, because of simple fact that database have no idea what is an ‘enum’. Yes simplest mapping between an enumeration and database type is integer. It is simplest but in my idea not best. For example I really do not remember (or do not WANT to remember) what is the meaning of 4 integer value in case of package shipment status. Continue reading “Safe cast string to enum”