NServiceBus.Guard.AgainstNullAndEmpty C# (CSharp) Method

AgainstNullAndEmpty() private method

private AgainstNullAndEmpty ( [ argumentName, [ value ) : void
argumentName [
value [
return void
        public static void AgainstNullAndEmpty([InvokerParameterName] string argumentName, [NotNull] string value)
        {
            if (string.IsNullOrWhiteSpace(value))
            {
                throw new ArgumentNullException(argumentName);
            }
        }

Usage Example

        /// <summary>
        /// Specifies the path and file name for the instance mapping XML. The default is <code>instance-mapping.xml</code>.
        /// </summary>
        /// <param name="filePath">The relative or absolute file path to the instance mapping XML file.</param>
        public InstanceMappingFileSettings FilePath(string filePath)
        {
            Guard.AgainstNullAndEmpty(nameof(filePath), filePath);

            this.GetSettings().Set(InstanceMappingFileFeature.FilePathSettingsKey, filePath);
            return(this);
        }
All Usage Examples Of NServiceBus.Guard::AgainstNullAndEmpty