asp.net-core - 为什么当我返回返回 JSON 时招摇给我 ISE 错误
问题描述
我有以下代码我不确定为什么 swagger 不喜欢它,我收到此错误
public JsonResult ProductsForTreeView(int? id)
{
var employees = from e in Context.ResponsibleParty
where (id.HasValue ? e.ProductKey == id : e.ProductKey == 0)
select new
{
id = e.ID,
Name = e.PartyName + " " + e.ProductCode,
hasChildren = (from q in Context.Products
where (q.ID == e.ProductKey)
select q
).Count() > 0
};
return Json(employees.ToList());
}
我收到这个错误
获取错误内部服务器错误 /swagger/v1/swagger.json
解决方案
推荐阅读
- angular - 如何在打字稿中初始化父类?
- java - Resilience4j Retry - 记录来自客户端的重试尝试?
- java - 将迭代代码转换为递归代码
- php - 获取数组 stdClass 对象的值
- assembly - 对在汇编中添加两个数字感到困惑
- python-3.x - 在 Python 中绘制变量 1 与变量 2 的曲线,曲线按变量 3 分组
- python - 子图线图中的 X-ticks 是不同的 python 图
- python - 使用 torch.nn.CrossEntropyLoss 时是否必须在 def forward 中添加 softmax
- rollupjs - TypeError:未定义纤维(React-Konva + RollupJS)
- mongodb - Apache Camel + MongoDB 文档不正确?