<PackageReference Include="System.Reactive" Version="6.0.1" />

Materialize<TSource>

sealed class Materialize<TSource> : Producer<Notification<TSource>, _<TSource>>
using System.Runtime.CompilerServices; namespace System.Reactive.Linq.ObservableImpl { [System.Runtime.CompilerServices.NullableContext(1)] [System.Runtime.CompilerServices.Nullable(new byte[] { 0, 1, 1, 1, 1 })] internal sealed class Materialize<[System.Runtime.CompilerServices.Nullable(2)] TSource> : Producer<Notification<TSource>, Materialize<TSource>._> { [System.Runtime.CompilerServices.Nullable(new byte[] { 0, 1, 1, 1 })] internal sealed class _ : Sink<TSource, Notification<TSource>> { public _(IObserver<Notification<TSource>> observer) : base(observer) { } public override void OnNext(TSource value) { ForwardOnNext(Notification.CreateOnNext<TSource>(value)); } public override void OnError(Exception error) { ForwardOnNext(Notification.CreateOnError<TSource>(error)); ForwardOnCompleted(); } public override void OnCompleted() { ForwardOnNext(Notification.CreateOnCompleted<TSource>()); ForwardOnCompleted(); } } private readonly IObservable<TSource> _source; public Materialize(IObservable<TSource> source) { _source = source; } public IObservable<TSource> Dematerialize() { return Observable.AsObservable<TSource>(_source); } [return: System.Runtime.CompilerServices.Nullable(new byte[] { 1, 0 })] protected override _ CreateSink(IObserver<Notification<TSource>> observer) { return new _(observer); } protected override void Run([System.Runtime.CompilerServices.Nullable(new byte[] { 1, 0 })] _ sink) { sink.Run(_source); } } }