protected override IConfigurable PrepareDataObject()
        {
            TaskLogger.LogEnter();
            DatabaseAvailabilityGroup databaseAvailabilityGroup = (DatabaseAvailabilityGroup)base.PrepareDataObject();

            if (base.Fields["NetworkCompression"] != null)
            {
                databaseAvailabilityGroup.NetworkCompression = this.NetworkCompression;
            }
            if (base.Fields["NetworkEncryption"] != null)
            {
                databaseAvailabilityGroup.NetworkEncryption = this.NetworkEncryption;
            }
            if (base.Fields["ManualDagNetworkConfiguration"] != null)
            {
                databaseAvailabilityGroup.ManualDagNetworkConfiguration = this.ManualDagNetworkConfiguration;
            }
            if (base.Fields["DatacenterActivationMode"] != null)
            {
                databaseAvailabilityGroup.DatacenterActivationMode = this.DatacenterActivationMode;
            }
            if (base.Fields.IsChanged("DatabaseAvailabilityGroupIpAddresses"))
            {
                if (base.Fields["DatabaseAvailabilityGroupIpAddresses"] == null)
                {
                    databaseAvailabilityGroup.DatabaseAvailabilityGroupIpv4Addresses = new MultiValuedProperty <IPAddress>
                    {
                        IPAddress.Any
                    };
                }
                else
                {
                    databaseAvailabilityGroup.DatabaseAvailabilityGroupIpv4Addresses = this.DatabaseAvailabilityGroupIpAddresses;
                }
            }
            if (base.Fields["DagConfiguration"] != null)
            {
                DatabaseAvailabilityGroupConfiguration databaseAvailabilityGroupConfiguration = DagConfigurationHelper.DagConfigIdParameterToDagConfig(this.DagConfiguration, this.ConfigurationSession);
                databaseAvailabilityGroup.DatabaseAvailabilityGroupConfiguration = databaseAvailabilityGroupConfiguration.Id;
            }
            else if (this.m_dagConfigParameterSpecified)
            {
                databaseAvailabilityGroup.DatabaseAvailabilityGroupConfiguration = null;
            }
            TaskLogger.LogExit();
            return(databaseAvailabilityGroup);
        }
        protected override IConfigurable PrepareDataObject()
        {
            TaskLogger.LogEnter();
            DatabaseAvailabilityGroup databaseAvailabilityGroup = new DatabaseAvailabilityGroup();

            databaseAvailabilityGroup.SetId(((ITopologyConfigurationSession)this.ConfigurationSession).GetDatabaseAvailabilityGroupContainerId().GetChildId(base.Name));
            databaseAvailabilityGroup.Name = this.m_dagName;
            databaseAvailabilityGroup.SetWitnessServer(this.m_fsw.FileShareWitnessShare, this.m_fsw.WitnessDirectory);
            databaseAvailabilityGroup.ThirdPartyReplication = this.ThirdPartyReplication;
            if (this.DagConfiguration != null)
            {
                DatabaseAvailabilityGroupConfiguration databaseAvailabilityGroupConfiguration = DagConfigurationHelper.DagConfigIdParameterToDagConfig(this.DagConfiguration, this.ConfigurationSession);
                databaseAvailabilityGroup.DatabaseAvailabilityGroupConfiguration = databaseAvailabilityGroupConfiguration.Id;
            }
            this.m_newDag = databaseAvailabilityGroup;
            TaskLogger.LogExit();
            return(databaseAvailabilityGroup);
        }