Exemple #1
0
        /// <summary>
        /// Update the Server Disaster Recovery Configuration
        /// </summary>
        /// <param name="entity">The output of apply user input to model</param>
        /// <returns>The input entity</returns>
        protected override IEnumerable <AzureSqlServerDisasterRecoveryConfigurationModel> PersistChanges(
            IEnumerable <AzureSqlServerDisasterRecoveryConfigurationModel> entity)
        {
            switch (ParameterSetName)
            {
            case ByFailoverParams:
                ModelAdapter.FailoverServerDisasterRecoveryConfiguration(this.ResourceGroupName,
                                                                         this.ServerName, entity.First(), AllowDataLoss.IsPresent);
                break;

            default:
                // Warning user that no options were provided so no action can be taken.
                WriteWarning(Resources.SetDisasterRecoveryConfigurationNoOptionProvided);
                break;
            }

            return(entity);
        }