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