Exemplo n.º 1
0
 private ServiceObjective CreateServiceObjectiveFromResponse(Management.Sql.Models.ServiceObjective response)
 {
     return(new ServiceObjective()
     {
         Name = response.Name,
         Id = Guid.Parse(response.Id),
         IsDefault = response.IsDefault,
         IsSystem = response.IsSystem,
         Enabled = response.Enabled,
         Description = response.Description,
         Context = this,
         DimensionSettings = CreateDimensionSettingsFromResponse(response.DimensionSettings)
     });
 }
        /// <summary>
        /// Convert a Management.Sql.Models.ServiceObjective to AzureSqlDatabaseServerServiceObjectiveModel
        /// </summary>
        /// <param name="resourceGroupName">The resource group the server is in</param>
        /// <param name="serverName">The name of the server</param>
        /// <param name="resp">The management client ServiceObjective response to convert</param>
        /// <returns>The converted ServiceObjective model</returns>
        private static AzureSqlServerServiceObjectiveModel CreateServiceObjectiveModelFromResponse(string resourceGroupName, string serverName, Management.Sql.Models.ServiceObjective resp)
        {
            AzureSqlServerServiceObjectiveModel slo = new AzureSqlServerServiceObjectiveModel();

            slo.ResourceGroupName    = resourceGroupName;
            slo.ServerName           = serverName;
            slo.ServiceObjectiveName = resp.Properties.ServiceObjectiveName;
            slo.IsDefault            = resp.Properties.IsDefault;
            slo.IsSystem             = resp.Properties.IsSystem;
            slo.Description          = resp.Properties.Description;
            slo.Enabled = resp.Properties.Enabled;

            return(slo);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Convert a Management.Sql.LegacySdk.Models.ServiceObjective to AzureSqlDatabaseServerServiceObjectiveModel
        /// </summary>
        /// <param name="resourceGroupName">The resource group the server is in</param>
        /// <param name="serverName">The name of the server</param>
        /// <param name="resp">The management client ServiceObjective response to convert</param>
        /// <returns>The converted ServiceObjective model</returns>
        private static AzureSqlServerServiceObjectiveModel CreateServiceObjectiveModelFromResponse(string resourceGroupName, string serverName, Management.Sql.Models.ServiceObjective resp)
        {
            AzureSqlServerServiceObjectiveModel slo = new AzureSqlServerServiceObjectiveModel()
            {
                ResourceGroupName    = resourceGroupName,
                ServerName           = serverName,
                ServiceObjectiveName = resp.ServiceObjectiveName,
                IsDefault            = resp.IsDefault,
                IsSystem             = resp.IsSystem,
                Description          = resp.Description,
                Enabled = resp.Enabled
            };

            return(slo);
        }