Esempio n. 1
0
        protected override async Task DefineObservables(ReactiveClientContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            await base.DefineObservables(context).ConfigureAwait(false);

            await context.UndefineObservableAsync(Platform.Constants.Identifiers.Observable.FireHose.Uri, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <Uri, T>(
                Platform.Constants.Identifiers.Observable.FireHose.Uri,
                topic => new TestFirehoseObservable <T>(topic).AsQbservable(),
                null,
                CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <Uri, T>(
                Constants.Test.HotTimelineObservable.Uri,
                uri => new TimelineObservable <T>(uri, false).AsQbservable(),
                null,
                CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <Uri, T>(
                Constants.Test.ColdTimelineObservable.Uri,
                uri => new TimelineObservable <T>(uri, true).AsQbservable(),
                null,
                CancellationToken.None).ConfigureAwait(false);
        }
Esempio n. 2
0
        protected virtual async Task DefineObservables(ReactiveClientContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            await context.DefineObservableAsync <Uri, T>(Platform.Constants.Identifiers.Observable.FireHose.Uri, uri => new FirehoseSubscribable <T>(uri).AsQbservable(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <int>, int>(Platform.Constants.Identifiers.Observable.GarbageCollector.Uri, source => new GarbageCollectorObservable(source.To <IAsyncReactiveQbservable <int>, ISubscribable <int> >()).AsQbservable(), null, CancellationToken.None).ConfigureAwait(false);
        }
Esempio n. 3
0
        protected virtual async Task DefineOperators(ReactiveClientContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, T, T> >, T>(new Uri(Client.Constants.Observable.Aggregate.Accumulate), (source, accumulate) => source.AsSync().Aggregate(accumulate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, R, Expression <Func <R, T, R> >, R>(new Uri(Client.Constants.Observable.Aggregate.Seed), (source, seed, accumulate) => source.AsSync().Aggregate(seed, accumulate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T1>, T2, Expression <Func <T2, T1, T2> >, Expression <Func <T2, R> >, R>(new Uri(Client.Constants.Observable.Aggregate.SeedResult), (source, seed, accumulate, selector) => source.AsSync().Aggregate(seed, accumulate, selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, bool> >, bool>(new Uri(Client.Constants.Observable.All.Predicate), (source, predicate) => source.AsSync().All(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, bool>(new Uri(Client.Constants.Observable.Any.NoArgument), source => source.AsSync().Any().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, bool> >, bool>(new Uri(Client.Constants.Observable.Any.Predicate), (source, predicate) => source.AsSync().Any(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T1>, IAsyncReactiveQbservable <T2>, Expression <Func <T1, T2, R> >, R>(new Uri(Client.Constants.Observable.CombineLatest.ObservableFunc), (source, otherSource, selector) => source.AsSync().CombineLatest(otherSource.AsSync(), selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, int>(new Uri(Client.Constants.Observable.Count.NoArgument), source => source.AsSync().Count().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, bool> >, int>(new Uri(Client.Constants.Observable.Count.Predicate), (source, predicate) => source.AsSync().Count(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, DateTimeOffset, T>(new Uri(Client.Constants.Observable.DelaySubscription.DateTimeOffset), (source, dueTime) => source.AsSync().DelaySubscription(dueTime).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, T>(new Uri(Client.Constants.Observable.DelaySubscription.TimeSpan), (source, dueTime) => source.AsSync().DelaySubscription(dueTime).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, DateTimeOffset, T>(new Uri(Client.Constants.Observable.DelaySubscription.V1.DateTimeOffset), (source, dueTime) => ReactiveQbservable.Timer(dueTime).SelectMany(_ => source.AsSync()).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, T>(new Uri(Client.Constants.Observable.DelaySubscription.V1.TimeSpan), (source, dueTime) => ReactiveQbservable.Timer(dueTime).SelectMany(_ => source.AsSync()).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, T>(new Uri(Client.Constants.Observable.DistinctUntilChanged.NoArgument), source => source.AsSync().DistinctUntilChanged(DataTypeEqualityComparer <T> .Default).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, R> >, T>(new Uri(Client.Constants.Observable.DistinctUntilChanged.Func), (source, keySelector) => source.AsSync().DistinctUntilChanged(keySelector, DataTypeEqualityComparer <R> .Default).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Action <T> >, T>(new Uri(Client.Constants.Observable.Do.OnNext), (source, onNext) => source.AsSync().Do(onNext).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Action <T> >, Expression <Action <Exception> >, T>(new Uri(Client.Constants.Observable.Do.OnNextOnError), (source, onNext, onError) => source.AsSync().Do(onNext, onError).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Action <T> >, Expression <Action>, T>(new Uri(Client.Constants.Observable.Do.OnNextOnCompleted), (source, onNext, onCompleted) => source.AsSync().Do(onNext, onCompleted).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Action <T> >, Expression <Action <Exception> >, Expression <Action>, T>(new Uri(Client.Constants.Observable.Do.AllActions), (source, onNext, onError, onCompleted) => source.AsSync().Do(onNext, onError, onCompleted).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, IAsyncReactiveQbserver <T>, T>(new Uri(Client.Constants.Observable.Do.Observer), (source, observer) => source.AsSync().Do(observer.AsSync()).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, R> >, IAsyncReactiveQbserver <R>, T>(new Uri(Client.Constants.Observable.Do.ObserverSelector), (source, selector, observer) => source.AsSync().Do(selector, observer.AsSync()).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Action>, T>(new Uri(Client.Constants.Observable.Finally.Action), (source, action) => source.AsSync().Finally(action).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, T>(new Uri(Client.Constants.Observable.FirstAsync.NoArgument), source => source.AsSync().FirstAsync().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, bool> >, T>(new Uri(Client.Constants.Observable.FirstAsync.Func), (source, predicate) => source.AsSync().FirstAsync(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, T>(new Uri(Client.Constants.Observable.FirstOrDefaultAsync.NoArgument), source => source.AsSync().FirstOrDefaultAsync().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, bool> >, T>(new Uri(Client.Constants.Observable.FirstOrDefaultAsync.Func), (source, predicate) => source.AsSync().FirstOrDefaultAsync(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, bool>(new Uri(Client.Constants.Observable.IsEmpty.NoArgument), source => source.AsSync().IsEmpty().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, long>(new Uri(Client.Constants.Observable.LongCount.NoArgument), source => source.AsSync().LongCount().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, bool> >, long>(new Uri(Client.Constants.Observable.LongCount.Predicate), (source, predicate) => source.AsSync().LongCount(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, T>(new Uri(Client.Constants.Observable.Retry.NoArgument), source => source.AsSync().Retry().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, int, T>(new Uri(Client.Constants.Observable.Retry.Count), (source, retryCount) => source.AsSync().Retry(retryCount).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <T, T>(new Uri(Client.Constants.Observable.Return.Value), value => ReactiveQbservable.Return(value).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, T>(new Uri(Client.Constants.Observable.Sample.TimeSpan), (source, interval) => source.AsSync().Sample(interval).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, IAsyncReactiveQbservable <R>, T>(new Uri(Client.Constants.Observable.Sample.Observable), (source, sampler) => source.AsSync().Sample(sampler.AsSync()).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, T, T> >, T>(new Uri(Client.Constants.Observable.Scan.Accumulate), (source, aggregate) => source.AsSync().Scan(aggregate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, R, Expression <Func <R, T, R> >, R>(new Uri(Client.Constants.Observable.Scan.Seed), (source, seed, aggregate) => source.AsSync().Scan(seed, aggregate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, R> >, R>(new Uri(Client.Constants.Observable.Select.Func), (source, selector) => source.AsSync().Select(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, int, R> >, R>(new Uri(Client.Constants.Observable.Select.IndexedFunc), (source, selector) => source.AsSync().Select(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, IAsyncReactiveQbservable <T>, bool>(new Uri(Client.Constants.Observable.SequenceEqual.NoArgument), (left, right) => left.AsSync().SequenceEqual(right.AsSync()).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, int, T>(new Uri(Client.Constants.Observable.Skip.Count), (source, count) => source.AsSync().Skip(count).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, T>(new Uri(Client.Constants.Observable.Skip.TimeSpan), (source, dueTime) => source.AsSync().Skip(dueTime).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, DateTimeOffset, T>(new Uri(Client.Constants.Observable.SkipUntil.DateTimeOffset), (source, dueTime) => source.AsSync().SkipUntil(dueTime).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T1>, IAsyncReactiveQbservable <T2>, T1>(new Uri(Client.Constants.Observable.SkipUntil.Observable), (source, triggeringSource) => source.AsSync().SkipUntil(triggeringSource.AsSync()).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, bool> >, T>(new Uri(Client.Constants.Observable.SkipWhile.Func), (source, predicate) => source.AsSync().SkipWhile(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, int, bool> >, T>(new Uri(Client.Constants.Observable.SkipWhile.IndexedFunc), (source, predicate) => source.AsSync().SkipWhile(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, T[], T>(new Uri(Client.Constants.Observable.StartWith.Array), (source, values) => source.AsSync().StartWith(values).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, int, T>(new Uri(Client.Constants.Observable.Take.Count), (source, count) => source.AsSync().Take(count).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, T>(new Uri(Client.Constants.Observable.Take.TimeSpan), (source, duration) => source.AsSync().Take(duration).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, DateTimeOffset, T>(new Uri(Client.Constants.Observable.TakeUntil.DateTimeOffset), (source, startTime) => source.AsSync().TakeUntil(startTime).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T1>, IAsyncReactiveQbservable <T2>, T1>(new Uri(Client.Constants.Observable.TakeUntil.Observable), (source, other) => source.AsSync().TakeUntil(other.AsSync()).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, bool> >, T>(new Uri(Client.Constants.Observable.TakeWhile.Func), (source, predicate) => source.AsSync().TakeWhile(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, int, bool> >, T>(new Uri(Client.Constants.Observable.TakeWhile.IndexedFunc), (source, predicate) => source.AsSync().TakeWhile(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <DateTimeOffset, long>(new Uri(Client.Constants.Observable.Timer.DateTimeOffset), dueTime => ReactiveQbservable.Timer(dueTime).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <DateTimeOffset, TimeSpan, long>(new Uri(Client.Constants.Observable.Timer.DateTimeOffsetTimeSpan), (dueTime, period) => ReactiveQbservable.Timer(dueTime, period).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <TimeSpan, long>(new Uri(Client.Constants.Observable.Timer.TimeSpan), dueTime => ReactiveQbservable.Timer(dueTime).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <TimeSpan, TimeSpan, long>(new Uri(Client.Constants.Observable.Timer.TimeSpanTimeSpan), (dueTime, period) => ReactiveQbservable.Timer(dueTime, period).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, IList <T> >(new Uri(Client.Constants.Observable.ToList.NoArgument), source => source.AsSync().ToList().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, bool> >, T>(new Uri(Client.Constants.Observable.Where.Func), (source, predicate) => source.AsSync().Where(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, int, bool> >, T>(new Uri(Client.Constants.Observable.Where.IndexedFunc), (source, predicate) => source.AsSync().Where(predicate).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, IAsyncReactiveQbservable <T>, T>(new Uri(Client.Constants.Observable.Merge.Binary), (left, right) => left.To <IAsyncReactiveQbservable <T>, IReactiveQbservable <T> >().Merge(right.To <IAsyncReactiveQbservable <T>, IReactiveQbservable <T> >()).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>[], T>(new Uri(Client.Constants.Observable.Merge.N), sources => ReactiveQbservable.Merge(sources.To <IAsyncReactiveQbservable <T>[], IReactiveQbservable <T>[]>()).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            // Non-parameterized defines
            var emptyFactory    = (Expression <Func <IAsyncReactiveQbservable <T> > >)(() => ReactiveQbservable.Empty <T>().AsAsync());
            var emptyObservable = context.Provider.CreateQbservable <T>(emptyFactory.Body);
            await context.DefineObservableAsync <T>(new Uri(Client.Constants.Observable.Empty.NoArgument), emptyObservable, null, CancellationToken.None).ConfigureAwait(false);

            var neverFactory    = (Expression <Func <IAsyncReactiveQbservable <T> > >)(() => ReactiveQbservable.Never <T>().AsAsync());
            var neverObservable = context.Provider.CreateQbservable <T>(neverFactory.Body);
            await context.DefineObservableAsync <T>(new Uri(Client.Constants.Observable.Never.NoArgument), neverObservable, null, CancellationToken.None).ConfigureAwait(false);

            // Higher order defines
            await context.DefineObservableAsync <IAsyncReactiveQbservable <IAsyncReactiveObservable <T> >, T>(new Uri(Client.Constants.Observable.Merge.NoArgument), source => source.To <IAsyncReactiveQbservable <IAsyncReactiveObservable <T> >, IReactiveQbservable <IReactiveObservable <T> > >().Merge().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <IAsyncReactiveObservable <T> >, T>(new Uri(Client.Constants.Observable.Switch.NoArgument), source => source.To <IAsyncReactiveQbservable <IAsyncReactiveObservable <T> >, IReactiveQbservable <IReactiveObservable <T> > >().Switch().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, T>(new Uri(Client.Constants.Observable.Throttle.TimeSpan), (source, dueTime) => source.AsSync().Throttle(_ => ReactiveQbservable.Timer(dueTime)).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, IAsyncReactiveQbservable <R> > >, R>(
                new Uri(Client.Constants.Observable.SelectMany.Func),
                (source, selector) => source.AsSync().SelectMany(selector.To <Expression <Func <T, IAsyncReactiveQbservable <R> > >, Expression <Func <T, IReactiveQbservable <R> > > >()).AsAsync(),
                null,
                CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T1>, Expression <Func <T1, IAsyncReactiveQbservable <T2> > >, Expression <Func <T1, T2, R> >, R>(
                new Uri(Client.Constants.Observable.SelectMany.FuncFunc),
                (source, collectionSelector, resultSelector) => source.AsSync().SelectMany(collectionSelector.To <Expression <Func <T1, IAsyncReactiveQbservable <T2> > >, Expression <Func <T1, IReactiveQbservable <T2> > > >(), resultSelector).AsAsync(),
                null,
                CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, IAsyncReactiveQbservable <T> >(new Uri(Client.Constants.Observable.Window.TimeDuration), (source, duration) => source.AsSync().Window(duration).To <IReactiveQbservable <IReactiveQbservable <T> >, IAsyncReactiveQbservable <IAsyncReactiveQbservable <T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, TimeSpan, IAsyncReactiveQbservable <T> >(new Uri(Client.Constants.Observable.Window.TimeDurationShift), (source, duration, shift) => source.AsSync().Window(duration, shift).To <IReactiveQbservable <IReactiveQbservable <T> >, IAsyncReactiveQbservable <IAsyncReactiveQbservable <T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, int, IAsyncReactiveQbservable <T> >(new Uri(Client.Constants.Observable.Window.Count), (source, count) => source.AsSync().Window(count).To <IReactiveQbservable <IReactiveQbservable <T> >, IAsyncReactiveQbservable <IAsyncReactiveQbservable <T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, int, int, IAsyncReactiveQbservable <T> >(new Uri(Client.Constants.Observable.Window.CountSkip), (source, count, skip) => source.AsSync().Window(count, skip).To <IReactiveQbservable <IReactiveQbservable <T> >, IAsyncReactiveQbservable <IAsyncReactiveQbservable <T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, int, IAsyncReactiveQbservable <T> >(new Uri(Client.Constants.Observable.Window.TimeCount), (source, duration, count) => source.AsSync().Window(duration, count).To <IReactiveQbservable <IReactiveQbservable <T> >, IAsyncReactiveQbservable <IAsyncReactiveQbservable <T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, IList <T> >(new Uri(Client.Constants.Observable.Buffer.TimeDuration), (source, duration) => source.AsSync().Buffer(duration).To <IReactiveQbservable <IList <T> >, IAsyncReactiveQbservable <IList <T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, TimeSpan, IList <T> >(new Uri(Client.Constants.Observable.Buffer.TimeDurationShift), (source, duration, shift) => source.AsSync().Buffer(duration, shift).To <IReactiveQbservable <IList <T> >, IAsyncReactiveQbservable <IList <T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, int, IList <T> >(new Uri(Client.Constants.Observable.Buffer.Count), (source, count) => source.AsSync().Buffer(count).To <IReactiveQbservable <IList <T> >, IAsyncReactiveQbservable <IList <T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, int, int, IList <T> >(new Uri(Client.Constants.Observable.Buffer.CountSkip), (source, count, skip) => source.AsSync().Buffer(count, skip).To <IReactiveQbservable <IList <T> >, IAsyncReactiveQbservable <IList <T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, TimeSpan, int, IList <T> >(new Uri(Client.Constants.Observable.Buffer.TimeCount), (source, duration, count) => source.AsSync().Buffer(duration, count).To <IReactiveQbservable <IList <T> >, IAsyncReactiveQbservable <IList <T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, T1> >, IAsyncReactiveGroupedQbservable <T1, T> >(new Uri(Client.Constants.Observable.GroupBy.Key), (source, keySelector) => source.AsSync().GroupBy(keySelector).To <IReactiveQbservable <IReactiveGroupedQbservable <T1, T> >, IAsyncReactiveQbservable <IAsyncReactiveGroupedQbservable <T1, T> > >(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, T1> >, Expression <Func <T, T2> >, IAsyncReactiveGroupedQbservable <T1, T2> >(new Uri(Client.Constants.Observable.GroupBy.KeyElement), (source, keySelector, elementSelector) => source.AsSync().GroupBy(keySelector, elementSelector).To <IReactiveQbservable <IReactiveGroupedQbservable <T1, T2> >, IAsyncReactiveQbservable <IAsyncReactiveGroupedQbservable <T1, T2> > >(), null, CancellationToken.None).ConfigureAwait(false);

            // Extension defines
            await DefineOperatorsExtension(context).ConfigureAwait(false);
        }
        public static async Task DefineOperatorsExtension(ReactiveClientContext context)
        {
            #region Aggregates

            #region Average
            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int32>, Double>(new Uri(Client.Constants.Observable.Average.NoSelector.Int32), source => source.AsSync().Average().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int32> >, Double>(new Uri(Client.Constants.Observable.Average.Selector.Int32), (source, selector) => source.AsSync().Average(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int64>, Double>(new Uri(Client.Constants.Observable.Average.NoSelector.Int64), source => source.AsSync().Average().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int64> >, Double>(new Uri(Client.Constants.Observable.Average.Selector.Int64), (source, selector) => source.AsSync().Average(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Single>, Single>(new Uri(Client.Constants.Observable.Average.NoSelector.Single), source => source.AsSync().Average().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Single> >, Single>(new Uri(Client.Constants.Observable.Average.Selector.Single), (source, selector) => source.AsSync().Average(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Double>, Double>(new Uri(Client.Constants.Observable.Average.NoSelector.Double), source => source.AsSync().Average().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Double> >, Double>(new Uri(Client.Constants.Observable.Average.Selector.Double), (source, selector) => source.AsSync().Average(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Decimal>, Decimal>(new Uri(Client.Constants.Observable.Average.NoSelector.Decimal), source => source.AsSync().Average().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Decimal> >, Decimal>(new Uri(Client.Constants.Observable.Average.Selector.Decimal), (source, selector) => source.AsSync().Average(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int32?>, Double?>(new Uri(Client.Constants.Observable.Average.NoSelector.NullableInt32), source => source.AsSync().Average().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int32?> >, Double?>(new Uri(Client.Constants.Observable.Average.Selector.NullableInt32), (source, selector) => source.AsSync().Average(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int64?>, Double?>(new Uri(Client.Constants.Observable.Average.NoSelector.NullableInt64), source => source.AsSync().Average().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int64?> >, Double?>(new Uri(Client.Constants.Observable.Average.Selector.NullableInt64), (source, selector) => source.AsSync().Average(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Single?>, Single?>(new Uri(Client.Constants.Observable.Average.NoSelector.NullableSingle), source => source.AsSync().Average().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Single?> >, Single?>(new Uri(Client.Constants.Observable.Average.Selector.NullableSingle), (source, selector) => source.AsSync().Average(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Double?>, Double?>(new Uri(Client.Constants.Observable.Average.NoSelector.NullableDouble), source => source.AsSync().Average().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Double?> >, Double?>(new Uri(Client.Constants.Observable.Average.Selector.NullableDouble), (source, selector) => source.AsSync().Average(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Decimal?>, Decimal?>(new Uri(Client.Constants.Observable.Average.NoSelector.NullableDecimal), source => source.AsSync().Average().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Decimal?> >, Decimal?>(new Uri(Client.Constants.Observable.Average.Selector.NullableDecimal), (source, selector) => source.AsSync().Average(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            #endregion

            #region Min
            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int32>, Int32>(new Uri(Client.Constants.Observable.Min.NoSelector.Int32), source => source.AsSync().Min().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int32> >, Int32>(new Uri(Client.Constants.Observable.Min.Selector.Int32), (source, selector) => source.AsSync().Min(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int64>, Int64>(new Uri(Client.Constants.Observable.Min.NoSelector.Int64), source => source.AsSync().Min().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int64> >, Int64>(new Uri(Client.Constants.Observable.Min.Selector.Int64), (source, selector) => source.AsSync().Min(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Single>, Single>(new Uri(Client.Constants.Observable.Min.NoSelector.Single), source => source.AsSync().Min().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Single> >, Single>(new Uri(Client.Constants.Observable.Min.Selector.Single), (source, selector) => source.AsSync().Min(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Double>, Double>(new Uri(Client.Constants.Observable.Min.NoSelector.Double), source => source.AsSync().Min().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Double> >, Double>(new Uri(Client.Constants.Observable.Min.Selector.Double), (source, selector) => source.AsSync().Min(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Decimal>, Decimal>(new Uri(Client.Constants.Observable.Min.NoSelector.Decimal), source => source.AsSync().Min().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Decimal> >, Decimal>(new Uri(Client.Constants.Observable.Min.Selector.Decimal), (source, selector) => source.AsSync().Min(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int32?>, Int32?>(new Uri(Client.Constants.Observable.Min.NoSelector.NullableInt32), source => source.AsSync().Min().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int32?> >, Int32?>(new Uri(Client.Constants.Observable.Min.Selector.NullableInt32), (source, selector) => source.AsSync().Min(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int64?>, Int64?>(new Uri(Client.Constants.Observable.Min.NoSelector.NullableInt64), source => source.AsSync().Min().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int64?> >, Int64?>(new Uri(Client.Constants.Observable.Min.Selector.NullableInt64), (source, selector) => source.AsSync().Min(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Single?>, Single?>(new Uri(Client.Constants.Observable.Min.NoSelector.NullableSingle), source => source.AsSync().Min().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Single?> >, Single?>(new Uri(Client.Constants.Observable.Min.Selector.NullableSingle), (source, selector) => source.AsSync().Min(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Double?>, Double?>(new Uri(Client.Constants.Observable.Min.NoSelector.NullableDouble), source => source.AsSync().Min().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Double?> >, Double?>(new Uri(Client.Constants.Observable.Min.Selector.NullableDouble), (source, selector) => source.AsSync().Min(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Decimal?>, Decimal?>(new Uri(Client.Constants.Observable.Min.NoSelector.NullableDecimal), source => source.AsSync().Min().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Decimal?> >, Decimal?>(new Uri(Client.Constants.Observable.Min.Selector.NullableDecimal), (source, selector) => source.AsSync().Min(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            #endregion

            #region Max
            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int32>, Int32>(new Uri(Client.Constants.Observable.Max.NoSelector.Int32), source => source.AsSync().Max().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int32> >, Int32>(new Uri(Client.Constants.Observable.Max.Selector.Int32), (source, selector) => source.AsSync().Max(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int64>, Int64>(new Uri(Client.Constants.Observable.Max.NoSelector.Int64), source => source.AsSync().Max().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int64> >, Int64>(new Uri(Client.Constants.Observable.Max.Selector.Int64), (source, selector) => source.AsSync().Max(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Single>, Single>(new Uri(Client.Constants.Observable.Max.NoSelector.Single), source => source.AsSync().Max().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Single> >, Single>(new Uri(Client.Constants.Observable.Max.Selector.Single), (source, selector) => source.AsSync().Max(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Double>, Double>(new Uri(Client.Constants.Observable.Max.NoSelector.Double), source => source.AsSync().Max().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Double> >, Double>(new Uri(Client.Constants.Observable.Max.Selector.Double), (source, selector) => source.AsSync().Max(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Decimal>, Decimal>(new Uri(Client.Constants.Observable.Max.NoSelector.Decimal), source => source.AsSync().Max().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Decimal> >, Decimal>(new Uri(Client.Constants.Observable.Max.Selector.Decimal), (source, selector) => source.AsSync().Max(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int32?>, Int32?>(new Uri(Client.Constants.Observable.Max.NoSelector.NullableInt32), source => source.AsSync().Max().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int32?> >, Int32?>(new Uri(Client.Constants.Observable.Max.Selector.NullableInt32), (source, selector) => source.AsSync().Max(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int64?>, Int64?>(new Uri(Client.Constants.Observable.Max.NoSelector.NullableInt64), source => source.AsSync().Max().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int64?> >, Int64?>(new Uri(Client.Constants.Observable.Max.Selector.NullableInt64), (source, selector) => source.AsSync().Max(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Single?>, Single?>(new Uri(Client.Constants.Observable.Max.NoSelector.NullableSingle), source => source.AsSync().Max().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Single?> >, Single?>(new Uri(Client.Constants.Observable.Max.Selector.NullableSingle), (source, selector) => source.AsSync().Max(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Double?>, Double?>(new Uri(Client.Constants.Observable.Max.NoSelector.NullableDouble), source => source.AsSync().Max().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Double?> >, Double?>(new Uri(Client.Constants.Observable.Max.Selector.NullableDouble), (source, selector) => source.AsSync().Max(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Decimal?>, Decimal?>(new Uri(Client.Constants.Observable.Max.NoSelector.NullableDecimal), source => source.AsSync().Max().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Decimal?> >, Decimal?>(new Uri(Client.Constants.Observable.Max.Selector.NullableDecimal), (source, selector) => source.AsSync().Max(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            #endregion

            #region Sum
            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int32>, Int32>(new Uri(Client.Constants.Observable.Sum.NoSelector.Int32), source => source.AsSync().Sum().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int32> >, Int32>(new Uri(Client.Constants.Observable.Sum.Selector.Int32), (source, selector) => source.AsSync().Sum(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int64>, Int64>(new Uri(Client.Constants.Observable.Sum.NoSelector.Int64), source => source.AsSync().Sum().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int64> >, Int64>(new Uri(Client.Constants.Observable.Sum.Selector.Int64), (source, selector) => source.AsSync().Sum(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Single>, Single>(new Uri(Client.Constants.Observable.Sum.NoSelector.Single), source => source.AsSync().Sum().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Single> >, Single>(new Uri(Client.Constants.Observable.Sum.Selector.Single), (source, selector) => source.AsSync().Sum(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Double>, Double>(new Uri(Client.Constants.Observable.Sum.NoSelector.Double), source => source.AsSync().Sum().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Double> >, Double>(new Uri(Client.Constants.Observable.Sum.Selector.Double), (source, selector) => source.AsSync().Sum(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Decimal>, Decimal>(new Uri(Client.Constants.Observable.Sum.NoSelector.Decimal), source => source.AsSync().Sum().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Decimal> >, Decimal>(new Uri(Client.Constants.Observable.Sum.Selector.Decimal), (source, selector) => source.AsSync().Sum(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int32?>, Int32?>(new Uri(Client.Constants.Observable.Sum.NoSelector.NullableInt32), source => source.AsSync().Sum().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int32?> >, Int32?>(new Uri(Client.Constants.Observable.Sum.Selector.NullableInt32), (source, selector) => source.AsSync().Sum(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Int64?>, Int64?>(new Uri(Client.Constants.Observable.Sum.NoSelector.NullableInt64), source => source.AsSync().Sum().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Int64?> >, Int64?>(new Uri(Client.Constants.Observable.Sum.Selector.NullableInt64), (source, selector) => source.AsSync().Sum(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Single?>, Single?>(new Uri(Client.Constants.Observable.Sum.NoSelector.NullableSingle), source => source.AsSync().Sum().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Single?> >, Single?>(new Uri(Client.Constants.Observable.Sum.Selector.NullableSingle), (source, selector) => source.AsSync().Sum(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Double?>, Double?>(new Uri(Client.Constants.Observable.Sum.NoSelector.NullableDouble), source => source.AsSync().Sum().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Double?> >, Double?>(new Uri(Client.Constants.Observable.Sum.Selector.NullableDouble), (source, selector) => source.AsSync().Sum(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <Decimal?>, Decimal?>(new Uri(Client.Constants.Observable.Sum.NoSelector.NullableDecimal), source => source.AsSync().Sum().AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            await context.DefineObservableAsync <IAsyncReactiveQbservable <T>, Expression <Func <T, Decimal?> >, Decimal?>(new Uri(Client.Constants.Observable.Sum.Selector.NullableDecimal), (source, selector) => source.AsSync().Sum(selector).AsAsync(), null, CancellationToken.None).ConfigureAwait(false);

            #endregion

            #endregion
        }
Esempio n. 5
0
        protected virtual async Task DefineObservables(ReactiveClientContext context)
        {
            await context.DefineObservableAsync <PersonObservableParameters, Person>(Constants.Identifiers.Observable.Person.Uri, parameters => new PersonObservable(parameters).AsQbservable(), null, CancellationToken.None);

            await context.DefineObservableAsync <int, int>(Constants.Identifiers.Observable.Range.Uri, count => new RangeObservable(count).AsQbservable(), null, CancellationToken.None);
        }