GET 申请没有 return 任何东西,并且一直在思考

GET petition doesn't return anything and stays thinking

我正在使用发送我的数据库的所有数据的 GET 请求创建 API。

它可以毫无问题地执行所有功能并获取所有数据,但是当到达 return 行时,它会停留在那里思考并且从不 return 任何东西。

        [HttpGet("GetAll")]
        [ProducesResponseType(StatusCodes.Status200OK)]
        public ActionResult<List<Lead>> GetAll()
        {
            ActionResult<List<Lead>> list = BadRequest();

            string query = @$"SELECT LeadID, CompanyName, CompanyAddress1, CompanyAddress2, CompanyCity,
                CompanyState, PersonFirstName, PersonPhoneNumber, PersonEmail, Details, Distribuidor,
                Comercial, TipoEstablecimiento, NombreChef, MailChef, JefeCompras, EmailJefeCompras,
                EmailRestaurante, Latitud, Longitud, IDGoogle, UltimaVisita, FechaVisita, Clasificacion FROM dbo.Lead";

            JsonArray ja = ExecQuery(query);
            
            if (ja.Count > 0) {
                var format = "dd/MM/yyyy h:mm:ss"; // DateTime format
                var dateTimeConverter = new IsoDateTimeConverter { DateTimeFormat = format };
                list = JsonConvert.DeserializeObject<List<Lead>>(ja.ToString(), dateTimeConverter)!;
            }
            else
                list = NotFound("There are no leads");

            Console.WriteLine("return");
            return list;
        }

在控制台中,我可以读取我在 return 之前发送的行“return”,然后停止并停留在那里思考,直到我在 Visual Studio 中停止项目。

我试过只发送一条线索,return没有问题。我尝试在控制台中打印我从数据库中获得的潜在客户列表,这也是正确的。

编辑:如果我调用我需要的所有列,return 需要 11 分钟才能得到结果。我有 ñ 和 ç 字符,这可能是问题所在吗?

已解决,因为在 return 行中,函数正在为 swagger 结果制作视图(10 分钟对于这个视图来说是很多时间!)。

我用 reactJS 做了一个请愿,它真的更快。

谢谢大家的帮助!