File tree Expand file tree Collapse file tree 1 file changed +19
-16
lines changed
src/ResourceManager/Sql/Commands.Sql/ServerUpgrade/Cmdlet Expand file tree Collapse file tree 1 file changed +19
-16
lines changed Original file line number Diff line number Diff line change @@ -86,25 +86,28 @@ public class StartAzureSqlServerUpgrade : AzureSqlServerUpgradeCmdletBase<AzureS
86
86
/// <returns>The generated model from user input</returns>
87
87
protected override IEnumerable < AzureSqlServerUpgradeStartModel > ApplyUserInputToModel ( IEnumerable < AzureSqlServerUpgradeStartModel > models )
88
88
{
89
- // Ignore user input and recalculate StorageMb based on Dtu and coefficient of the edition
90
- foreach ( var elasticPoolProperties in ElasticPoolCollection )
89
+ if ( ElasticPoolCollection != null )
91
90
{
92
- switch ( elasticPoolProperties . Edition . ToLower ( ) )
91
+ // Ignore user input and recalculate StorageMb based on Dtu and coefficient of the edition
92
+ foreach ( var elasticPoolProperties in ElasticPoolCollection )
93
93
{
94
- case "basic" :
95
- elasticPoolProperties . StorageMb = elasticPoolProperties . Dtu * StorageMbPerDtuBasic ;
96
- break ;
97
- case "standard" :
98
- elasticPoolProperties . StorageMb = elasticPoolProperties . Dtu * StorageMbPerDtuStandard ;
99
- break ;
100
- case "premium" :
101
- elasticPoolProperties . StorageMb = elasticPoolProperties . Dtu * StorageMbPerDtuPremium ;
102
- break ;
103
- default :
104
- throw new PSArgumentException ( string . Format ( "Edition {0} is invalid" , elasticPoolProperties . Edition ) ) ;
94
+ switch ( elasticPoolProperties . Edition . ToLower ( ) )
95
+ {
96
+ case "basic" :
97
+ elasticPoolProperties . StorageMb = elasticPoolProperties . Dtu * StorageMbPerDtuBasic ;
98
+ break ;
99
+ case "standard" :
100
+ elasticPoolProperties . StorageMb = elasticPoolProperties . Dtu * StorageMbPerDtuStandard ;
101
+ break ;
102
+ case "premium" :
103
+ elasticPoolProperties . StorageMb = elasticPoolProperties . Dtu * StorageMbPerDtuPremium ;
104
+ break ;
105
+ default :
106
+ throw new PSArgumentException ( string . Format ( "Edition {0} is invalid" , elasticPoolProperties . Edition ) ) ;
107
+ }
108
+
105
109
}
106
-
107
- }
110
+ }
108
111
109
112
var newEntity = new List < AzureSqlServerUpgradeStartModel > ( ) ;
110
113
newEntity . Add ( new AzureSqlServerUpgradeStartModel
You can’t perform that action at this time.
0 commit comments