string strName = \"John\"; public enum Name { John,Peter } private void DoSomething(string myname) { case1: if(myname.Equals(Name.John) //returns false {
One solution could be to get the type of the enum, and then the types name.
myname.Equals(Enum.GetName(typeof(Name)))
http://msdn.microsoft.com/en-us/library/system.enum.getname.aspx