예제 #1
0
        public async Task <IActionResult> Update(MenuItemListModel model)
        {
            using (HttpClient client = new HttpClient())
            {
                if (!ModelState.IsValid)
                {
                    return(View(model));
                }
                else
                {
                    var         data    = JsonConvert.SerializeObject(model);
                    HttpContent content = new StringContent(data, System.Text.Encoding.UTF8, "application/json");
                    await client.PostAsync("https://localhost:44380/api/MenuItem/Update", content);

                    return(RedirectToAction("Index"));
                }
            }
        }
예제 #2
0
파일: NavModels.cs 프로젝트: ManEx/WebManex
 public NavSearchModel(MxUser mxUser)
 {
     GenCategoryList = new MenuItemListModel(true, GetSearchMenu(string.Empty));
     this.Usr        = mxUser;
 }
예제 #3
0
파일: NavModels.cs 프로젝트: ManEx/WebManex
 public NavSearchModel(MxUser mxUser)
 {
     GenCategoryList = new MenuItemListModel(true, GetSearchMenu(string.Empty));
     this.Usr = mxUser;
 }
        //public IViewComponentResult Invoke()
        //{
        //    MenuItemListModel model = _menuDataRepository.GetMenus();
        //    return View(model);
        //}

        public async Task <IViewComponentResult> InvokeAsync()
        {
            MenuItemListModel model = await _menuDataRepository.GetMenus();

            return(View(model));
        }