Example #1
0
        protected internal virtual IList <EventSubscriptionEntity> FindMessageStartEventSubscriptions(
            CommandContext commandContext, string messageName, CorrelationSet correlationSet)
        {
            IEventSubscriptionManager eventSubscriptionManager = commandContext.EventSubscriptionManager;

            if (correlationSet.IsTenantIdSet)
            {
                EventSubscriptionEntity eventSubscription = eventSubscriptionManager.FindMessageStartEventSubscriptionByNameAndTenantId(messageName, correlationSet.TenantId);
                if (eventSubscription != null)
                {
                    return(new List <EventSubscriptionEntity> {
                        eventSubscription
                    });
                }
                else
                {
                    return(new List <EventSubscriptionEntity>());
                }
            }
            return(eventSubscriptionManager.FindMessageStartEventSubscriptionByName(messageName));;
        }