I'm trying to do something in C# that I do all the time in Ruby, and I wondered what the closest thing would be.
If the Enum does not contain a definition for my integer value, I want it to default to a certain value. Can I do this in one line?
Ruby-ish assignment (two examples):
namedStr = Enum.GetName(typeof(myEnum), enumedInt) || "DEFAULT"
or
namedStr = Enum.GetName(typeof(myEnum), enumedInt)
namedStr ||= "DEFAULT"