Пример #1
0
        public override IProjectSubscriptionUpdate ToActualModel()
        {
            var model = new ActualModel();

            if (CurrentState != null)
            {
                model.CurrentState = CurrentState.Select(x => new KeyValuePair <string, IProjectRuleSnapshot>(x.Key, x.Value))
                                     .ToImmutableDictionary();
            }
            else
            {
                model.CurrentState = ImmutableDictionary <string, IProjectRuleSnapshot> .Empty;
            }

            if (ProjectChanges != null)
            {
                model.ProjectChanges = ProjectChanges.Select(x => new KeyValuePair <string, IProjectChangeDescription>(x.Key, x.Value.ToActualModel()))
                                       .ToImmutableDictionary();
            }
            else
            {
                model.ProjectChanges = ImmutableDictionary <string, IProjectChangeDescription> .Empty;
            }

            if (ProjectConfiguration != null)
            {
                model.ProjectConfiguration = ProjectConfiguration.ToActualModel();
            }

            return(model);
        }
Пример #2
0
        public override IProjectSubscriptionUpdate ToActualModel()
        {
            IImmutableDictionary <string, IProjectRuleSnapshot>      currentState;
            IImmutableDictionary <string, IProjectChangeDescription> projectChanges;
            ProjectConfiguration projectConfiguration;

            if (CurrentState != null)
            {
                currentState = CurrentState.Select(x => new KeyValuePair <string, IProjectRuleSnapshot>(x.Key, x.Value)).ToImmutableDictionary();
            }
            else
            {
                currentState = ImmutableDictionary <string, IProjectRuleSnapshot> .Empty;
            }

            if (ProjectChanges != null)
            {
                projectChanges = ProjectChanges.Select(x => new KeyValuePair <string, IProjectChangeDescription>(x.Key, x.Value.ToActualModel())).ToImmutableDictionary();
            }
            else
            {
                projectChanges = ImmutableDictionary <string, IProjectChangeDescription> .Empty;
            }

            if (ProjectConfiguration != null)
            {
                projectConfiguration = ProjectConfiguration.ToActualModel();
            }
            else
            {
                projectConfiguration = ProjectConfigurationFactory.Create("TEST");
            }

            return(new ActualModel(currentState, projectChanges, projectConfiguration));
        }