ToEnum

ToEnum(Type, int)

public static Enum ToEnum(Type enumType, int value) ;

Description

Convert int type to enum type.

Parameters

Parameter Name Description
enumType Converted enum type
value Int type value you want to convert

Returns

Converted enum type value. If conversion is not possible, null is returned.

ToEnum<T>(int)

public static T ToEnum<T>(int value) ;

Description

Convert int type to enum type.

Type Parameters

Type Parameter Name Description Type Constraints
T Converted enum type
  • Enum

Parameters

Parameter Name Description
value Int type value you want to convert

Returns

Converted enum type value.