/// <summary> /// Creates a new <see cref="LazyDeltaPipelineStage{TInput, TOutput}"/> with the specified name, extractor and input. /// </summary> /// <param name="name">The name of this stage.</param> /// <param name="extractor">The function used to extract a delta.</param> /// <param name="input">The pipeline stage which to extract delta from.</param> public LazyDeltaPipelineStage( string name, DeltaExtractor <TInput, TOutput> extractor, IPipelineStage <TInput> input) { Name = name ?? throw new ArgumentNullException(nameof(name)); Extractor = extractor ?? throw new ArgumentNullException(nameof(extractor)); Input = input ?? throw new ArgumentNullException(nameof(input)); OldValue = input.GetValue(); CurrentDelta = default !;
/// <summary> /// Creates a new <see cref="DeltaPipelineStage{TInput, TOutput}"/> with the specified name, extractor and input. /// </summary> /// <param name="name">The name of this stage.</param> /// <param name="deltaExtractor">The function used to extract a delta.</param> /// <param name="input">The pipeline stage which to extract delta from.</param> /// <param name="initial">The initial delta value.</param> public DeltaPipelineStage( string name, DeltaExtractor <TInput, TOutput> deltaExtractor, IPipelineStage <TInput> input, TOutput initial) { Name = name ?? throw new ArgumentNullException(nameof(name)); DeltaExtractor = deltaExtractor ?? throw new ArgumentNullException(nameof(deltaExtractor)); Input = input ?? throw new ArgumentNullException(nameof(input)); CurrentDelta = initial; OldValue = input.GetValue(); this.AddDependencies(input); }