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")); } } }
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)); }