コード例 #1
0
ファイル: SubscriptionDto.cs プロジェクト: rvajustin/notifo
        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);
        }
コード例 #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);
        }
コード例 #3
0
ファイル: SubscriptionDto.cs プロジェクト: djhome50/notifo
        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);
        }