I have the following method and enum:
public int GetRowType(string pk)
{
return Convert.ToInt32(pk.Substring(2, 2));
}
public enum CONTENT {
Menu = 0,
Article = 1,
FavoritesList = 2,
ContentBlock = 3,
Topic = 6,
List = 7
};
Here I am trying to check if the result of my method is equal to the value of the enum but I am getting an error:
GetRowType(content) == CONTENT.Topic
Can someone give me some advice on what I am doing wrong?
Gives me an error: Error 2
Operator '==' cannot be applied to operands of type 'int' and 'Storage.Constants.CONTENT'
The whole idea is to work with the enum directly. so to fix up your method and return a enum instead of an integer: