/// <summary> /// Cast TEnum to <see cref="ushort"/> /// </summary> /// <param name="enum"></param> /// <param name="defaultVal"></param> /// <typeparam name="TEnum"></typeparam> /// <returns></returns> public static ushort CastToUShort <TEnum>(this TEnum @enum, ushort defaultVal = default) where TEnum : struct => NumericConv.EnumToUInt16(@enum, defaultVal);