コード例 #1
0
        /// <summary>
        /// Returns a <see cref="IEntityDispatcherInternal"/> which should be used to dispatch the provided <see cref="FeedMessage"/>
        /// </summary>
        /// <param name="message">The <see cref="FeedMessage"/> instance which needs to be dispatched.</param>
        /// <returns>a <see cref="IEntityDispatcherInternal"/> which should be used to dispatch the provided <see cref="FeedMessage"/></returns>
        private IEntityDispatcherInternal SelectDispatcher(FeedMessage message)
        {
            Guard.Argument(message, nameof(message)).NotNull();

            if (!message.IsEventRelated)
            {
                return(this);
            }

            var specificDispatcher = _sportSpecificDispatchers.Get(URN.Parse(message.EventId), message.SportId);

            return(specificDispatcher == null
                ? this
                : (IEntityDispatcherInternal)specificDispatcher);
        }
コード例 #2
0
        /// <summary>
        /// Returns a <see cref="IEntityDispatcherInternal"/> which should be used to dispatch the provided <see cref="FeedMessage"/>
        /// </summary>
        /// <param name="message">The <see cref="FeedMessage"/> instance which needs to be dispatched.</param>
        /// <returns>a <see cref="IEntityDispatcherInternal"/> which should be used to dispatch the provided <see cref="FeedMessage"/></returns>
        private IEntityDispatcherInternal SelectDispatcher(FeedMessage message)
        {
            Contract.Requires(message != null);
            Contract.Ensures(Contract.Result <IEntityDispatcherInternal>() != null);

            if (!message.IsEventRelated)
            {
                return(this);
            }

            var specificDispatcher = _sportSpecificDispatchers.Get(URN.Parse(message.EventId), message.SportId);

            return(specificDispatcher == null
                ? this
                : (IEntityDispatcherInternal)specificDispatcher);
        }