public static BindingStorage ToBindingStorage(BindingConfiguration binding) { BindingStorage bindingStorage = new BindingStorage(); bindingStorage[ADObjectSchema.OrganizationalUnitRoot] = new ADObjectId(binding.TenantId); bindingStorage.Name = binding.Name; bindingStorage.SetId((ADObjectId)DalHelper.ConvertFromStoreObject(binding.ObjectId, typeof(ADObjectId))); UnifiedPolicyStorageFactory.CopyPropertiesToStorage <BindingConfiguration>(new TenantSettingFacade <BindingStorage>(bindingStorage), binding); if (binding.AppliedScopes != null && binding.AppliedScopes.Changed) { bindingStorage.AppliedScopes = new MultiValuedProperty <ScopeStorage>(from s in binding.AppliedScopes.ChangedValues select UnifiedPolicyStorageFactory.ToScopeStorage(s)); } return(bindingStorage); }