public async Task <State> SendSms(string from, string to, string text) { //Added non-blocking code for scalability return(await Task <State> .Run(() => { using (var op = new SmsOperations()) { return op.SendSms(from, to, text); } })); }
public IActionResult SendSms(string [] _selectedPhoneNumbers, string _message) { try { var smsResult = SmsOperations.SendSms(_selectedPhoneNumbers, _message); return(smsResult == true?Json(true) : Json(false)); } catch (Exception exc) { throw exc; } }