I have an enum
public enum INFLOW_SEARCH_ON { ON_ENTITY_HANDLE = 0, ON_LABEL = 1, ON_NODE_HANDLE = 2 } // enum I
You should use (int) MyEnumVariable. All enums by default are inherited from int.
(int) MyEnumVariable
int