/// <summary> /// Whether or not the field involves collection of floating-point number values. /// </summary> /// <param name="fieldGenerator">The field generator wrapping the field</param> /// <returns>Whether or not the field involves collection of floating-point number values</returns> public static bool IsFloatingNumber <TModel, T>(this IFieldGenerator <TModel, T> fieldGenerator) { return(NumericTypes.Contains(fieldGenerator.GetUnderlyingType())); }
/// <summary> /// Whether or not the field represented by the field generator is an enum that can represent multiple values. /// i.e. whether or not the field is a flags enum. /// </summary> /// <returns>Whether or not the field is a flags enum</returns> public static bool HasMultipleEnumValues <TModel, T>(this IFieldGenerator <TModel, T> fieldGenerator) { return(!fieldGenerator.HasEnumerableValues() && fieldGenerator.GetUnderlyingType().IsEnum && fieldGenerator.GetUnderlyingType().GetCustomAttributes(typeof(FlagsAttribute), false).Any()); }
/// <summary> /// Whether or not the field involves collection of integral number values. /// </summary> /// <param name="fieldGenerator">The field generator wrapping the field</param> /// <returns>Whether or not the field involves collection of integral number values</returns> public static bool IsIntegralNumber <TModel, T>(this IFieldGenerator <TModel, T> fieldGenerator) { return(IntTypes.Contains(fieldGenerator.GetUnderlyingType())); }