Пример #1
0
        internal IReliableQubscription CreateSubscription <TArgs>(IReliableQubscriptionFactory <TArgs> factory, TArgs argument, Uri subscriptionUri, object state)
        {
            var expression = Expression.Invoke(factory.Expression, Expression.Constant(argument, typeof(TArgs)));

            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 qubscription = new KnownReliableQubscription(normalized, subscriptionUri, this);
            CreateSubscriptionCore(qubscription, state);

#pragma warning restore CA2000
#pragma warning restore IDE0079

            return(qubscription);
        }
Пример #2
0
        internal IReliableQubscription CreateSubscription(IReliableQubscriptionFactory factory, Uri subscriptionUri, 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 qubscription = new KnownReliableQubscription(normalized, subscriptionUri, this);
            CreateSubscriptionCore(qubscription, state);

#pragma warning restore CA2000
#pragma warning restore IDE0079

            var parameterExpression   = Expression.Parameter(typeof(IReliableQubscription), subscriptionUri.AbsoluteUri);
            var parameterQubscription = new KnownReliableQubscription(parameterExpression, subscriptionUri, this);
            return(parameterQubscription);
        }