我有以下方法和枚举:
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'