public void TestSetUserMenu() { UserMenuService service = new UserMenuService(); int userID = 23; string menuIDs = "1P|3P|4P|4.1|4.2|4.3|4.4|5P|5.1|5.2|5.3|6P|6.1|6.2|6.3|6.4"; UserMenuViewModel ViewModel = service.SetUserMenu(userID, menuIDs); Console.WriteLine(UtilTest.GetJson(ViewModel)); }
public object SetUserMenu([FromBody] JObject obj) { try { string userID = obj["userID"].ToString(); string menuIDs = obj["menuIDs"].ToString(); return(service.SetUserMenu(Convert.ToInt32(userID), menuIDs)); } catch (Exception e) { return(9999); } }