Exemple #1
0
        public static SubscriptionDto FromDomainObject(Subscription subscription)
        {
            var result = new SubscriptionDto
            {
                TopicPrefix = subscription.TopicPrefix
            };

            if (subscription.TopicSettings != null)
            {
                result.TopicSettings = new NotificationSettingsDto();

                foreach (var(key, value) in subscription.TopicSettings)
                {
                    if (value != null)
                    {
                        result.TopicSettings[key] = NotificationSettingDto.FromDomainObject(value);
                    }
                }
            }
            else
            {
                result.TopicSettings = new NotificationSettingsDto();
            }

            return(result);
        }
Exemple #2
0
        public static SubscriptionDto FromDomainObject(Subscription subscription)
        {
            var result = new SubscriptionDto
            {
                TopicPrefix = subscription.TopicPrefix
            };

            if (subscription.TopicSettings != null)
            {
                foreach (var(key, value) in subscription.TopicSettings)
                {
                    if (value != null)
                    {
                        result.TopicSettings[key] = ChannelSettingDto.FromDomainObject(value);
                    }
                }
            }

            return(result);
        }
Exemple #3
0
        public static SubscriptionDto FromDomainObject(Subscription subscription)
        {
            var result = new SubscriptionDto
            {
                TopicPrefix = subscription.TopicPrefix
            };

            result.TopicSettings ??= new Dictionary <string, NotificationSettingDto>();

            if (subscription.TopicSettings != null)
            {
                foreach (var(key, value) in subscription.TopicSettings)
                {
                    if (value != null)
                    {
                        result.TopicSettings[key] = NotificationSettingDto.FromDomainObject(value);
                    }
                }
            }

            return(result);
        }