controllers页面:public class TB_MenuList
{
/// <summary>
/// 主键
/// </summary>
public int ID { get; set; }
/// <summary>
/// 菜单标题
/// </summary>
public string Title { get; set; }
/// <summary>
/// 菜单英文标题(备用)
/// </summary>
public string Title_Eng { get; set; }
/// <summary>
/// 用户可见权限(0代表无需无权限)
/// </summary>
public int DisplayPermission { get; set; }
/// <summary>
/// 父级ID(用来保存上一节点ID,0代表顶级)
/// </summary>
public int ParentID { get; set; }
/// <summary>
/// 菜单链接地址
/// </summary>
public string URL { get; set; }
/// <summary>
/// 是否在新页面打开
/// </summary>
public int IsNewPage { get; set; }
}
public class TB_MenuListDBContext : DbContext
{
public DbSet<TB_MenuList> TB_MenuList { get; set; }
}
private TB_MenuListDBContext db = new TB_MenuListDBContext();
//
// GET: /TB_MenuList/
public ActionResult Index()
{
return View(db.TB_MenuList.ToList());
}
//
// GET: /TB_MenuList/Details/5
public ActionResult Details(int id = 0)
{
TB_MenuList tb_menulist = db.TB_MenuList.Find(id);
if (tb_menulist == null)
{
return HttpNotFound();
}
return View(tb_menulist);
}