次のメソッドと列挙型があります。
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
};
ここで、メソッドの結果が列挙型の値と等しいかどうかを確認しようとしていますが、エラーが発生しています。
GetRowType(content) == CONTENT.Topic
誰かが私が間違っていることについてアドバイスをくれますか?
Gives me an error: Error 2
Operator '==' cannot be applied to operands of type 'int' and 'Storage.Constants.CONTENT'