public static bool AnyEmpty(params string[] args) => args.Any(x => string.IsNullOrWhiteSpace(x));
Example usage:
var networkPath = ConfigurationManager.AppSettings["IfsUncPath"]; var userName = ConfigurationManager.AppSettings["IfsUserName"]; var password = ConfigurationManager.AppSettings["IfsPassword"]; if (AnyEmpty(networkPath, userName, password)) throw new Exception("AS400 IFS connection not configured");
316600cookie-checkC# AnyEmpty