Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EventToPutWithIdOnRecordFilterMatch{TId}"/> class.
        /// </summary>
        /// <param name="recordExistsMatchStrategy">The <see cref="RecordExistsMatchStrategy"/> to use with supplied filter.</param>
        /// <param name="eventToPut">The event to put on a match.</param>
        /// <param name="chainOfResponsibilityLinkMatchStrategy">OPTIONAL strategy override to determine what to do in the execution on a match; DEFAULT is Halt and Complete.</param>
        public EventToPutWithIdOnRecordFilterMatch(
            RecordExistsMatchStrategy recordExistsMatchStrategy,
            EventToPutWithId <TId> eventToPut,
            ChainOfResponsibilityLinkMatchStrategy chainOfResponsibilityLinkMatchStrategy = ChainOfResponsibilityLinkMatchStrategy.MatchHaltsEvaluationOfChainAndCompletes)
        {
            recordExistsMatchStrategy.MustForArg(nameof(recordExistsMatchStrategy)).NotBeEqualTo(CompositeHandlingStatusMatchStrategy.Unknown);
            eventToPut.MustForArg(nameof(eventToPut)).NotBeNull();
            chainOfResponsibilityLinkMatchStrategy.MustForArg(nameof(chainOfResponsibilityLinkMatchStrategy)).NotBeEqualTo(ChainOfResponsibilityLinkMatchStrategy.Unknown);

            this.RecordExistsMatchStrategy = recordExistsMatchStrategy;
            this.EventToPut = eventToPut;
            this.ChainOfResponsibilityLinkMatchStrategy = chainOfResponsibilityLinkMatchStrategy;
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EventToPutWithIdOnHandlingStatusMatch{TId}"/> class.
        /// </summary>
        /// <param name="statusToMatch">The <see cref="CompositeHandlingStatus"/> to match.</param>
        /// <param name="compositeHandlingStatusMatchStrategy">The <see cref="CompositeHandlingStatusMatchStrategy"/> to use with <paramref name="statusToMatch"/>.</param>
        /// <param name="eventToPut">The event to put on a match.</param>
        /// <param name="chainOfResponsibilityLinkMatchStrategy">OPTIONAL strategy override to determine what to do in the execution on a match; DEFAULT is Halt and Complete.</param>
        public EventToPutWithIdOnHandlingStatusMatch(
            CompositeHandlingStatus statusToMatch,
            CompositeHandlingStatusMatchStrategy compositeHandlingStatusMatchStrategy,
            EventToPutWithId <TId> eventToPut,
            ChainOfResponsibilityLinkMatchStrategy chainOfResponsibilityLinkMatchStrategy = ChainOfResponsibilityLinkMatchStrategy.MatchHaltsEvaluationOfChainAndCompletes)
        {
            statusToMatch.MustForArg(nameof(statusToMatch)).NotBeEqualTo(CompositeHandlingStatus.Unknown);
            compositeHandlingStatusMatchStrategy.MustForArg(nameof(compositeHandlingStatusMatchStrategy)).NotBeEqualTo(CompositeHandlingStatusMatchStrategy.Unknown);
            eventToPut.MustForArg(nameof(eventToPut)).NotBeNull();
            chainOfResponsibilityLinkMatchStrategy.MustForArg(nameof(chainOfResponsibilityLinkMatchStrategy)).NotBeEqualTo(ChainOfResponsibilityLinkMatchStrategy.Unknown);

            this.StatusToMatch = statusToMatch;
            this.CompositeHandlingStatusMatchStrategy = compositeHandlingStatusMatchStrategy;
            this.EventToPut = eventToPut;
            this.ChainOfResponsibilityLinkMatchStrategy = chainOfResponsibilityLinkMatchStrategy;
        }
        public EventToPutWithIdOnRecordFilterMatch <TId> DeepCloneWithChainOfResponsibilityLinkMatchStrategy(ChainOfResponsibilityLinkMatchStrategy chainOfResponsibilityLinkMatchStrategy)
        {
            var result = new EventToPutWithIdOnRecordFilterMatch <TId>(
                this.RecordExistsMatchStrategy.DeepClone(),
                this.EventToPut?.DeepClone(),
                chainOfResponsibilityLinkMatchStrategy);

            return(result);
        }
        public EventToPutWithIdOnHandlingStatusMatch <TId> DeepCloneWithChainOfResponsibilityLinkMatchStrategy(ChainOfResponsibilityLinkMatchStrategy chainOfResponsibilityLinkMatchStrategy)
        {
            var result = new EventToPutWithIdOnHandlingStatusMatch <TId>(
                this.StatusToMatch.DeepClone(),
                this.CompositeHandlingStatusMatchStrategy.DeepClone(),
                this.EventToPut?.DeepClone(),
                chainOfResponsibilityLinkMatchStrategy);

            return(result);
        }