c# - 我的 ASP.NET Core API 没有返回所有行
问题描述
我的 ASP.NET Core API 只返回 40 行中的前两行。
我努力了
services.AddMvc().AddJsonOptions(options => options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore);
它将 VS 代码发送到一个无限循环。关于在哪里寻找解决这个问题的任何想法?我正在使用浏览器和邮递员来使用具有相同结果的 api。
[EnableCors]
[HttpGet]
public ActionResult<IEnumerable<Fuaxclient>> GetClient()
{
return _context.clientList;
}
我期望得到大约 48 行的正确 json 代码。相反,我得到 2 行和损坏的 json。我从 FireFox Web 控制台收到此错误
error: null
headers: Object { normalizedNames: Map(0), lazyUpdate: null, headers: Map(0) }
message: "Http failure response for https://fuaxclientapi.azurewebsites.net/api/fuaxclient: 500 Internal Server Error"
name: "HttpErrorResponse"
ok: false
status: 500
statusText: "Internal Server Error"
url: "https://fuaxclientapi.azurewebsites.net/api/fuaxclient"
如果您想尝试 API 以了解我在说什么,该 API 仍在运行。</p>
解决方案
好的,经过大量挖掘和研究并将我的头撞在桌子上,我发现了我的问题。我的数据库中有 NULL,API 在 NULL 处停止。
推荐阅读
- pandas - Pandas 数据透视表显示每个条目的相同行数
- jquery - 在laravel中过滤年份和月份?
- amazon-systems-manager - AWS Systems Manager 中的 Run Command 计划
- c++ - 理解 hello_world boost sml 状态机库
- sql - 获取其他行总计和列总计
- javascript - 尝试在移动设备上移动/显示/隐藏搜索输入,但移动版本由于 ID 不唯一而无法运行
- tfx - 如何为 TFX+GPU 支持构建 Docker 映像?
- linux - make: *** [makefile.unix:193: obj/rpcclient.o] 错误 1
- php - 只为一个名字上色 PHP
- javascript - MutationObserver 检测空子元素的变化