public async Task <IActionResult> PostOtpResend([FromForm] OtpRequestViewModel value) { Random random = new Random(); SingleResponse <OtpRequestViewModel> response = new SingleResponse <OtpRequestViewModel>(); string OTP = string.Empty; try { if (ModelState.IsValid) { if (!(await _unit.IUser.Exists(u => u.PhoneNumber == value.MobileNo)).UserObject) { ModelState.AddModelError("PPhone", "Your Phone no. is not register with us"); response.Message = "Your Phone no. is not register with us"; response.Status = false; response.ErrorTypeCode = (int)ErrorMessage.PhoneOrEmailNotRegistor; } else { string strPhone = ("91" + value.MobileNo); var otpresposedata = await _smsHandler.ResendOtpAsync(strPhone); if (otpresposedata.type == "success") { response.Message = "OTP Send on your registor no."; response.Status = true; response.Data = value; return(response.ToHttpResponse()); } } } } catch (Exception ex) { response.Status = false; response.Message = "There was an internal error, please contact to technical support."; ErrorTrace.Logger(LogArea.ApplicationTier, ex); } return(response.ToHttpResponse()); }