Exemplo n.º 1
0
        /// <summary>
        /// Converts the given SecureConnectionPolicyProperties to a SecureConnectionPolicyCreateOrUpdateProperties that has the same values for the properties
        /// </summary>
        /// <param name="properties">The properties to be used for creating the returned value</param>
        /// <returns>A SecureConnectionPolicyCreateOrUpdateProperties which reflected the given properties</returns>
        private DatabaseSecureConnectionPolicyCreateOrUpdateProperties ConvertToSecureConnectionPolicyCreateProperties(DatabaseSecureConnectionPolicyProperties properties)
        {
            DatabaseSecureConnectionPolicyCreateOrUpdateProperties createProps = new DatabaseSecureConnectionPolicyCreateOrUpdateProperties();

            createProps.SecurityEnabledAccess = properties.SecurityEnabledAccess;
            return(createProps);
        }
        /// <summary>
        /// Takes the cmdlets model object and transform it to the policy as expected by the endpoint
        /// </summary>
        /// <param name="model">The Secure Connection Policy model object</param>
        /// <returns>The communication model object</returns>
        private DatabaseSecureConnectionPolicyCreateOrUpdateParameters PolicizeDatabaseSecureConnectionModel(DatabaseSecureConnectionPolicyModel model)
        {
            DatabaseSecureConnectionPolicyCreateOrUpdateParameters updateParameters = new DatabaseSecureConnectionPolicyCreateOrUpdateParameters();
            DatabaseSecureConnectionPolicyCreateOrUpdateProperties properties       = new DatabaseSecureConnectionPolicyCreateOrUpdateProperties();

            updateParameters.Properties      = properties;
            properties.SecurityEnabledAccess = model.SecureConnectionState == SecureConnectionStateType.Required ? SecurityConstants.SecureConnectionEndpoint.Required : SecurityConstants.SecureConnectionEndpoint.Optional;
            return(updateParameters);
        }