From 3610fd2220e644ca6c240f28f7b145f4f29d9c9c Mon Sep 17 00:00:00 2001 From: Simon Redman Date: Wed, 16 Dec 2020 10:09:27 -0800 Subject: [PATCH] Change type of "Status" field back to string per static anaysis complaints --- .../Model/AzureSqlDatabaseImportExportStatusModel.cs | 2 +- .../Sql/ImportExport/Service/ImportExportDatabaseAdapter.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Sql/Sql/ImportExport/Model/AzureSqlDatabaseImportExportStatusModel.cs b/src/Sql/Sql/ImportExport/Model/AzureSqlDatabaseImportExportStatusModel.cs index 163330060db4..b142f9ba98c9 100644 --- a/src/Sql/Sql/ImportExport/Model/AzureSqlDatabaseImportExportStatusModel.cs +++ b/src/Sql/Sql/ImportExport/Model/AzureSqlDatabaseImportExportStatusModel.cs @@ -72,7 +72,7 @@ public string RequestType /// their automation. /// Compare to /// - public OperationStatus? Status + public string Status { get; set; diff --git a/src/Sql/Sql/ImportExport/Service/ImportExportDatabaseAdapter.cs b/src/Sql/Sql/ImportExport/Service/ImportExportDatabaseAdapter.cs index 4652a7e7e4c3..60981a255467 100644 --- a/src/Sql/Sql/ImportExport/Service/ImportExportDatabaseAdapter.cs +++ b/src/Sql/Sql/ImportExport/Service/ImportExportDatabaseAdapter.cs @@ -143,13 +143,15 @@ public AzureSqlDatabaseImportExportStatusModel GetStatus(string operationStatusL HttpResponseMessage rawHttpResponse; ImportExportOperationResult response = Communicator.GetOperationStatus(operationStatusLink, out rawHttpResponse); + OperationStatus? operationStatus = GetOperationStatusFromHttpStatus(rawHttpResponse.StatusCode); + AzureSqlDatabaseImportExportStatusModel status = new AzureSqlDatabaseImportExportStatusModel() { ErrorMessage = response.ErrorMessage, LastModifiedTime = response.LastModifiedTime, QueuedTime = response.QueuedTime, StatusMessage = response.Status, // in spite of the name, the field called "Status" is the correct one to put into the "StatusMessage" field - Status = GetOperationStatusFromHttpStatus(rawHttpResponse.StatusCode), + Status = operationStatus.HasValue ? operationStatus.Value.ToString() : "", RequestType = response.RequestType, PrivateEndpointRequestStatus = response.PrivateEndpointConnections?.Select(pec => new PrivateEndpointRequestStatus() {