public static ScopeConfiguration FromScopeStorage(ScopeStorage scopeStorage)
        {
            ScopeConfiguration scopeConfiguration = new ScopeConfiguration(scopeStorage.OrganizationalUnitRoot.ObjectGuid, scopeStorage.Id.ObjectGuid);

            UnifiedPolicyStorageFactory.CopyPropertiesFromStorage <ScopeConfiguration>(scopeConfiguration, new TenantSettingFacade <ScopeStorage>(scopeStorage));
            return(scopeConfiguration);
        }
        public static RuleConfiguration FromRuleStorage(RuleStorage ruleStorage)
        {
            RuleConfiguration ruleConfiguration = new RuleConfiguration(ruleStorage.OrganizationalUnitRoot.ObjectGuid, ruleStorage.Id.ObjectGuid);

            UnifiedPolicyStorageFactory.CopyPropertiesFromStorage <RuleConfiguration>(ruleConfiguration, new TenantSettingFacade <RuleStorage>(ruleStorage));
            return(ruleConfiguration);
        }
        public static AssociationConfiguration FromAssociationStorage(AssociationStorage associationStorage)
        {
            AssociationConfiguration associationConfiguration = new AssociationConfiguration(associationStorage.OrganizationalUnitRoot.ObjectGuid, associationStorage.Id.ObjectGuid);

            UnifiedPolicyStorageFactory.CopyPropertiesFromStorage <AssociationConfiguration>(associationConfiguration, new TenantSettingFacade <AssociationStorage>(associationStorage));
            return(associationConfiguration);
        }
        public static PolicyConfiguration FromPolicyStorage(PolicyStorage policyStorage)
        {
            PolicyConfiguration policyConfiguration = new PolicyConfiguration(policyStorage.OrganizationalUnitRoot.ObjectGuid, policyStorage.Id.ObjectGuid);

            UnifiedPolicyStorageFactory.CopyPropertiesFromStorage <PolicyConfiguration>(policyConfiguration, new TenantSettingFacade <PolicyStorage>(policyStorage));
            return(policyConfiguration);
        }
        public static BindingConfiguration FromBindingStorage(BindingStorage bindingStorage)
        {
            BindingConfiguration bindingConfiguration = new BindingConfiguration(bindingStorage.OrganizationalUnitRoot.ObjectGuid, bindingStorage.Id.ObjectGuid);

            UnifiedPolicyStorageFactory.CopyPropertiesFromStorage <BindingConfiguration>(bindingConfiguration, new TenantSettingFacade <BindingStorage>(bindingStorage));
            if (bindingStorage.AppliedScopes.Any <ScopeStorage>() || bindingStorage.RemovedScopes.Any <ScopeStorage>())
            {
                bindingConfiguration.AppliedScopes = new IncrementalCollection <ScopeConfiguration>(from s in bindingStorage.AppliedScopes
                                                                                                    select UnifiedPolicyStorageFactory.FromScopeStorage(s), bindingStorage.RemovedScopes.Select((ScopeStorage s) => UnifiedPolicyStorageFactory.FromScopeStorage(s)));
            }
            else
            {
                bindingConfiguration.AppliedScopes = new IncrementalCollection <ScopeConfiguration>();
            }
            return(bindingConfiguration);
        }