GetEnum

GetEnum(string, Enum)

public Enum GetEnum(string name, Enum defaultValue) ;

Description

Get the value of the Enum type.

Parameters

Parameter Name Description
name Name.
defaultValue Default value. It is returned when there is no parameter.

Returns

The value of the parameter. If there is no parameter, it returns defaultValue.

GetEnum(int, Enum)

public Enum GetEnum(int id, Enum defaultValue) ;

Description

Get the value of the Enum type.

Parameters

Parameter Name Description
id ID.
defaultValue Default value. It is returned when there is no parameter.

Returns

The value of the parameter. If there is no parameter, it returns defaultValue.

GetEnum<TEnum>(string, TEnum)

public TEnum GetEnum<TEnum>(string name, TEnum defaultValue) ;

Description

Get the value of the Enum type.

Type Parameters

Type Parameter Name Description Type Constraints
TEnum Type of enum to get
  • Enum

Parameters

Parameter Name Description
name Name.
defaultValue Default value. It is returned when there is no parameter.

Returns

The value of the parameter. If there is no parameter, it returns defaultValue.

GetEnum<TEnum>(string)

public TEnum GetEnum<TEnum>(string name) ;

Description

Get the value of the Enum type.

Type Parameters

Type Parameter Name Description Type Constraints
TEnum Type of enum to get
  • Enum

Parameters

Parameter Name Description
name Name.

Returns

The value of the parameter. If there is no parameter, it returns default(TEnum).

GetEnum<TEnum>(int, TEnum)

public TEnum GetEnum<TEnum>(int id, TEnum defaultValue) ;

Description

Get the value of the Enum type.

Type Parameters

Type Parameter Name Description Type Constraints
TEnum Type of enum to get
  • Enum

Parameters

Parameter Name Description
id ID.
defaultValue Default value. It is returned when there is no parameter.

Returns

The value of the parameter. If there is no parameter, it returns defaultValue.

GetEnum<TEnum>(int)

public TEnum GetEnum<TEnum>(int id) ;

Description

Get the value of the Enum type.

Type Parameters

Type Parameter Name Description Type Constraints
TEnum Type of enum to get
  • Enum

Parameters

Parameter Name Description
id ID.

Returns

The value of the parameter. If there is no parameter, it returns default(TEnum).