NServiceBus.Guard.AgainstNull C# (CSharp) Method

AgainstNull() private method

private AgainstNull ( [ argumentName, [ value ) : void
argumentName [
value [
return void
        public static void AgainstNull([InvokerParameterName] string argumentName, [NotNull] object value)
        {
            if (value == null)
            {
                throw new ArgumentNullException(argumentName);
            }
        }

Usage Example

Example #1
0
        /// <summary>
        /// Returns the configured delivery delay by using <see cref="DelayDeliveryWith" />.
        /// </summary>
        /// <param name="options">The options being extended.</param>
        /// <returns>The configured <see cref="TimeSpan" /> or <c>null</c>.</returns>
        public static TimeSpan?GetDeliveryDelay(this SendOptions options)
        {
            Guard.AgainstNull(nameof(options), options);

            return((options.DelayedDeliveryConstraint as DelayDeliveryWith)?.Delay);
        }
All Usage Examples Of NServiceBus.Guard::AgainstNull