【发布时间】:2021-08-06 01:36:31
【问题描述】:
这是我的控制器:
[HttpGet("")]
public IActionResult Index()
{
ViewBag.showMonster = _context.Monsters.ToList();
return View();
}
这是我的cshtml:
<h1>@ViewBag.showMonster</h1>
这是错误的语法吗? 我的观点正在显示:
System.Collections.Generic.List1[PracticeEntity.Models.Monster]
而不是我数据库中的实际行。
【问题讨论】:
标签: c# asp.net asp.net-mvc asp.net-core