I have an asmx web service in c# and have recently discovered the very useful FlagsAttribute
for enums. My declaration is as follows:
[Flags]
public enum eAdPriority
{
None = 0,
Gold = 1,
Silver = 2,
Homepage = 4
}
I then test the enum as follows:
eAdPriority test = eAdPriority.Gold | eAdPriority.Homepage | eAdPriority.Silver;
test.HasFlag(eAdPriority.Gold);
However, the HasFlag
part of the last line is highlighted red Cannot resolve symbol 'HasFlag' and my code wont compile. Any ideas why?