public static double?GetCreditValueOrNull(this IHasValue hasValue) { if (hasValue.Value > 0) { return(hasValue.GetCreditValue()); } return(null); }