Beispiel #1
0
        internal IReliableMultiQubject <TInput, TOutput> CreateStream <TArgs, TInput, TOutput>(IReliableQubjectFactory <TInput, TOutput, TArgs> factory, TArgs argument, Uri streamUri, object state)
        {
            var expression = Expression.Invoke(factory.Expression, Expression.Constant(argument, typeof(TArgs)));

            var normalized = _expressionServices.Normalize(expression);

            var qubject = new KnownReliableQubject <TInput, TOutput>(normalized, streamUri, this);

            CreateStreamCore(qubject, state);

            return(qubject);
        }
Beispiel #2
0
        internal IReliableMultiQubject <TInput, TOutput> CreateStream <TInput, TOutput>(IReliableQubjectFactory <TInput, TOutput> factory, Uri streamUri, object state)
        {
            var expression = Expression.Invoke(factory.Expression);

            var normalized = _expressionServices.Normalize(expression);

#pragma warning disable IDE0079 // Remove unnecessary suppression.
#pragma warning disable CA2000  // Dispose objects before losing scope. (IDisposable semantics are used for deletion behavior here.)

            var qubject = new KnownReliableQubject <TInput, TOutput>(normalized, streamUri, this);
            CreateStreamCore(qubject, state);

#pragma warning restore CA2000
#pragma warning restore IDE0079

            var parameterExpression = Expression.Parameter(typeof(IReliableMultiQubject <TInput, TOutput>), streamUri.AbsoluteUri);
            var parameterQubject    = new KnownReliableQubject <TInput, TOutput>(parameterExpression, streamUri, this);
            return(parameterQubject);
        }