File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
src/ResourceManager/Sql/Commands.Sql/Database/Cmdlet Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 12
12
// limitations under the License.
13
13
// ----------------------------------------------------------------------------------
14
14
15
+ using System ;
15
16
using System . Collections . Generic ;
16
17
using System . Linq ;
17
18
using System . Management . Automation ;
@@ -116,8 +117,21 @@ protected override IEnumerable<AzureSqlDatabaseModel> ApplyUserInputToModel(IEnu
116
117
/// <returns>The input entity</returns>
117
118
protected override IEnumerable < AzureSqlDatabaseModel > PersistChanges ( IEnumerable < AzureSqlDatabaseModel > entity )
118
119
{
120
+ AzureSqlDatabaseModel response = null ;
121
+ try
122
+ {
123
+ response = ModelAdapter . UpsertDatabase ( this . ResourceGroupName , this . ServerName , entity . First ( ) ) ;
124
+ }
125
+ catch ( ArgumentNullException ex )
126
+ {
127
+ if ( ex . ParamName == "operationStatusLink" )
128
+ {
129
+ response = ModelAdapter . GetDatabase ( this . ResourceGroupName , this . ServerName , entity . First ( ) . DatabaseName ) ;
130
+ }
131
+ }
132
+
119
133
return new List < AzureSqlDatabaseModel > ( ) {
120
- ModelAdapter . UpsertDatabase ( this . ResourceGroupName , this . ServerName , entity . First ( ) )
134
+ response
121
135
} ;
122
136
}
123
137
}
You can’t perform that action at this time.
0 commit comments