![](/img/trans.png)
[英]How to resolve System.Reflection.TargetInvocationException' error?
[英]Web Api response error for get request - System.Reflection.TargetInvocationException - 500 internal server error
当我使用 Postman 调试它时,它可以调用 Web Api 方法。 The controller is scaffolded using option "Web Api 2 Controller with actions, using Entity Framework" in .NET Framework 4.6.1, Web Application Web, Api project.
// GET: api/MovieHallDetails
public IQueryable<MovieHallDetails> GetMovieHallDetails() {
return db.MovieHallDetails;
}
这些是我用 select 和 SQL select 查询时表中的示例数据:
Id MovieHallId Seats SeatStatus
297 9 1,1 0
298 9 1,2 0
299 9 1,3 0
300 9 1,4 0
I also have many other similar Web Api methods for other tables and I could issues get request and able to get the successful web api response except for this one.
这是我在 Postman 测试时返回的结果
500内部服务器错误
块引用
MovieHallDetails
没有无参数构造函数。 添加参数构造函数后,问题解决。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.