Exemplo n.º 1
0
        /// <summary>
        ///     Add a Result.
        /// </summary>
        /// <param name="valueAction">
        ///     An action to create a <see cref="ThreatListUpdateResult" /> indicating a retrieved
        ///     <see cref="ThreatList" /> and the threats associated with it that should be added to and removed from
        ///     the locally stored copy of the threat list.
        /// </param>
        /// <returns>
        ///     This threat list update response builder.
        /// </returns>
        /// <exception cref="System.ArgumentNullException">
        ///     Thrown if <paramref name="valueAction" /> is a null reference.
        /// </exception>
        public ThreatListUpdateResponseBuilder AddResult(Func <ThreatListUpdateResultBuilder, ThreatListUpdateResult> valueAction)
        {
            Guard.ThrowIf(nameof(valueAction), valueAction).Null();

            // ...
            //
            // Throws an exception if the operation fails.
            var threatListUpdateResultBuilder = ThreatListUpdateResult.Build();
            var threatListUpdateResult        = valueAction(threatListUpdateResultBuilder);

            this.AddResult(threatListUpdateResult);

            return(this);
        }