<PackageReference Include="System.Reactive" Version="6.0.0-preview.1" />

SumDecimal

sealed class SumDecimal : Producer<decimal, _>
using System.Runtime.CompilerServices; namespace System.Reactive.Linq.ObservableImpl { [System.Runtime.CompilerServices.NullableContext(1)] [System.Runtime.CompilerServices.Nullable(new byte[] { 0, 1 })] internal sealed class SumDecimal : Producer<decimal, SumDecimal._> { [System.Runtime.CompilerServices.NullableContext(0)] internal sealed class _ : IdentitySink<decimal> { private decimal _sum; [System.Runtime.CompilerServices.NullableContext(1)] public _(IObserver<decimal> observer) : base(observer) { } public override void OnNext(decimal value) { _sum += value; } public override void OnCompleted() { ForwardOnNext(_sum); ForwardOnCompleted(); } } private readonly IObservable<decimal> _source; public SumDecimal(IObservable<decimal> source) { _source = source; } protected override _ CreateSink(IObserver<decimal> observer) { return new _(observer); } protected override void Run(_ sink) { sink.Run(_source); } } }