5
Answers

Use enum as key in dictionary

Andy

Andy

3y
3k
1

why cannot i initialise a dictionary with values from enum. for example

enum cust {
OneTime
}

dictionary<int, string> custs = new dictionary<int, string>() {
{cust.OneTime, "some string values"}
}

getting argument is not assignable to type int error

any thoughts?

Answers (5)