Possible Duplicate:
Get Enum from Description attribute
I have an Enum that uses the descriptions attribute. I want to be able to set on objects -> property value based on a string passed in. If the string matches the one of the enum values description then that value should be chosen. Is it possible for me to this without using a lengthy for loop?
public enum Rule
{
....
[Description("New Seed")]
Rule2 = 2,
....
}
what I'm hoping for is something like
var object = new oject{ rule = Rule.Where(r=> r.description == rulestring)}