public static T GetOrThrowIfDefault <T>([NotNull, NotNullIfNotNull("source")] this T source, string argName, string?customErrorText = null) where T : struct { if (Equals(source, default(T))) { throw ExceptionsHelper.ArgumentNotTypeDefault(argName, customErrorText); } return(source); }