public JsonResult CheckPassport(string passportNumber) { var passportService = new PassportService(); var t = Task.Run(() => passportService.CheckPassport(passportNumber)); t.Wait(); var result = t.Result; if (result == 1) { var passportData = passportService.GetPassportData(passportNumber); return(Json(passportData, JsonRequestBehavior.AllowGet)); } return(Json("Номер паспорта не правильный", JsonRequestBehavior.AllowGet)); }