Skip to content

,System.IObservable{--1})} ,System.IObservable{--0})}

Subject.Create(IObserver, IObservable) method

Defined in

Type: Subject Namespace: System.Reactive.Subjects Assembly: System.Reactive.dll

Applies to

netstandard2.0

Overloads

  • 1. public static ISubject<TSource, TResult> Create<TSource, TResult>(IObserver<TSource> observer, IObservable<TResult> observable)
  • 2. public static ISubject<T> Create<T>(IObserver<T> observer, IObservable<T> observable)

1. Overload

public static ISubject<TSource, TResult> Create<TSource, TResult>(IObserver<TSource> observer, IObservable<TResult> observable)

Summary: Creates a subject from the specified observer and observable.

Type parameters

NameDescription
TSourceThe type of the elements received by the observer.
TResultThe type of the elements produced by the observable sequence.

Parameters

NameTypeDescription
observerIObserverThe observer used to send messages to the subject.
observableIObservableThe observable used to subscribe to messages sent from the subject.

Returns: ISubject -- Subject implemented using the given observer and observable.

Exceptions

TypeCondition
System.ArgumentNullExceptionobserver or observable is null.

2. Overload

public static ISubject<T> Create<T>(IObserver<T> observer, IObservable<T> observable)

Summary: Creates a subject from the specified observer and observable.

Type parameters

NameDescription
TThe type of the elements received by the observer and produced by the observable sequence.

Parameters

NameTypeDescription
observerIObserverThe observer used to send messages to the subject.
observableIObservableThe observable used to subscribe to messages sent from the subject.

Returns: ISubject -- Subject implemented using the given observer and observable.

Exceptions

TypeCondition
System.ArgumentNullExceptionobserver or observable is null.