Exemple #1
0
        public bool RemoveChannelSubscriptionChannelScope(Guid sessionId, IRequestUuidSource request)
        {
            CheckLocked();

            ChannelSubscription channelSubscription;

            if (!ChannelSubscriptionsBySessionId.TryGetValue(sessionId, out channelSubscription))
            {
                return(false);
            }

            MockSubscriptionInfo subscriptionInfo;

            if (!channelSubscription.ChannelScopesByChannelScopeUuid.TryGetValue(request.RequestUuid, out subscriptionInfo))
            {
                return(false);
            }

            if (!channelSubscription.ChannelScopesByChannelScopeUuid.Remove(request.RequestUuid))
            {
                return(false);
            }

            return(UnsubscribeObjectNotifications(subscriptionInfo.RequestUuid));
        }
Exemple #2
0
 /// <summary>
 /// Initializes a <see cref="IErrorInfo"/> instance for object not found.
 /// </summary>
 /// <param name="errorInfo">The <see cref="IErrorInfo"/> instance to update.</param>
 /// <param name="argument">The argument name.</param>
 /// <param name="value">The argument value.</param>
 /// <returns>The initialized <see cref="IErrorInfo"/> instance.</returns>
 public static IErrorInfo NotFound(this IErrorInfo errorInfo, string argument, IRequestUuidSource value)
 {
     return(errorInfo.NotFound(argument, value?.RequestUuid));
 }
Exemple #3
0
 /// <summary>
 /// Initializes a <see cref="IErrorInfo"/> instance for object not found.
 /// </summary>
 /// <param name="errorInfo">The <see cref="IErrorInfo"/> instance to update.</param>
 /// <param name="value">The argument value.</param>
 /// <returns>The initialized <see cref="IErrorInfo"/> instance.</returns>
 public static IErrorInfo NotFound(this IErrorInfo errorInfo, IRequestUuidSource value) => errorInfo.NotFound(value?.RequestUuid);
Exemple #4
0
 /// <summary>
 /// Initializes a <see cref="IErrorInfo"/> instance for an invalid argument.
 /// </summary>
 /// <param name="errorInfo">The <see cref="IErrorInfo"/> instance to update.</param>
 /// <param name="argument">The argument name.</param>
 /// <param name="value">The argument value.</param>
 /// <returns>The initialized <see cref="IErrorInfo"/> instance.</returns>
 public static IErrorInfo InvalidArgument(this IErrorInfo errorInfo, string argument, IRequestUuidSource value) => errorInfo.InvalidArgument(argument, value?.RequestUuid);