Esempio n. 1
0
 public bool Add([FromBody] Menu menu)
 {
     try
     {
         return(_menuDao.Add(menu));
     }
     catch (Exception ex)
     {
         nlog.Error(ex, "添加菜单失败!", menu.ToJSON());
         return(false);
     }
 }
Esempio n. 2
0
        public void Add()
        {
            var model = new Menu()
            {
                Name     = "首页",
                ParentId = 0,
                SortNum  = 1,
                Url      = "/home/index"
            };

            var result = MenuDao.Add(model);

            Assert.AreEqual(1, result);
        }