private static async Task <string> GenerateVerificationCode(string phoneNumber, UserActionEnum userAction) { try { using (var client = new UserAccountClient()) { var result = await client.GenerateVerificationCodeAsync(phoneNumber, userAction); result.ThrowIfException(true); if (result.Success) { return(result.Result); } } } catch (Exception exception) { WebLog.LogException(exception); } return(null); }