diff --git a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Transcription/TranscriptionData.cs b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Transcription/TranscriptionData.cs index 0cbf7ba34fa52..b1b9a77cb379e 100644 --- a/sdk/communication/Azure.Communication.CallAutomation/src/Models/Transcription/TranscriptionData.cs +++ b/sdk/communication/Azure.Communication.CallAutomation/src/Models/Transcription/TranscriptionData.cs @@ -64,26 +64,20 @@ internal TranscriptionData(string text, string format, double confidence, ulong private static ResultStatus ConvertToResultStatusEnum(string resultStatus) { - switch (resultStatus) - { - case "intermediate": - return ResultStatus.Intermediate; - case "final": - return ResultStatus.Final; - default: - throw new NotSupportedException(resultStatus); - } + if ("Intermediate".Equals(resultStatus, StringComparison.OrdinalIgnoreCase)) + return ResultStatus.Intermediate; + else if ("Final".Equals(resultStatus, StringComparison.OrdinalIgnoreCase)) + return ResultStatus.Final; + else + throw new NotSupportedException(resultStatus); } private static TextFormat ConvertToTextFormatEnum(string format) { - switch (format) - { - case "display": - return TextFormat.Display; - default: - throw new NotSupportedException(format); - } + if ("Display".Equals(format, StringComparison.OrdinalIgnoreCase)) + return TextFormat.Display; + else + throw new NotSupportedException(format); } } }