我想从我的数据库中填充下拉列表。在Razor页面中,使用模型绑定的方法是什么?
public IActionResult OnGet()
{
var model = new Item
{
ItemTypes = _context.ItemTypes.ToList(),
Parts = _context.Parts.ToList(),
Sections = _context.Sections.ToList()
};
return Page();
}