I have an enumeration:
public enum MyColours { Red, Green, Blue, Yellow, Fuchsia, Aqua, Orange }
and I have a s
Given the latest and greatest changes to .NET (+ Core) and C# 7, here is the best solution:
var ignoreCase = true; Enum.TryParse("red", ignoreCase , out MyColours colour);
colour variable can be used within the scope of Enum.TryParse