【发布时间】:2019-05-30 01:43:14
【问题描述】:
为什么我不是通过链接从数据库中获取所有数据 https://localhost:XXXXX/api/comments (获取请求) 更新后页面数据不再出现..
回应: [{"id":1,"text":"Comment1","userId":1,"parentCommentId":null,"user":null,"parentComment":null,"childrenComments":null},{"id ":2,"text":"Comment2","userId":1,"parentCommentId":1,"user":null,"parentComment":{"id":1,"text":"Comment1"," userId":1,"parentCommentId":null,"user":null,"parentComment":null,"childrenComments":[
不加载从属项.. 我做错了什么?
// GET: api/Comments
[HttpGet]
public IEnumerable<Comment> GetComments()
{
return _context.Comments;
}
【问题讨论】:
标签: json entity-framework linq rest asp.net-core