public static SqlParameter AddIntEnumParam <T>(this SqlCommand command, string parameterName, T?value) where T : struct, Enum { int?intValue; if (value.HasValue) { intValue = ToIntCache <T> .Func(value.Value); } else { intValue = null; } return(command.AddParam(parameterName, intValue)); }
public static SqlParameter AddIntEnumParam <T>(this SqlCommand command, string parameterName, T value) where T : Enum => command.AddParam(parameterName, ToIntCache <T> .Func(value));