I need to convert a list of enum values ββto a single line for storage in my db; then convert back when i get from the database.
Each enumeration value is currently a prime integer, so you need to outsmart a little to create an additional table.
So, in the example below, if the user selects Mother, Father and Sister, then the value stored in the database will be "0,1,3"
public enum MyEnum
{
Mother = 0,
Father = 1,
Gran = 2,
Sister = 3,
Brother = 4
}
I'm new to C #, so I'm not sure if there is a good way to do this - I could not find anything obvious when hunting Google!
Greetings in advance :) - L
laura source
share