// GET: api/Command public IEnumerable <Command> GetAllCmd() { if (HttpContext.Current.Session[SessionInfo.C_Session_sessioninfo] == null) { throw new Exception("尚未登录!"); } SessionInfo sessionInfo = (SessionInfo)HttpContext.Current.Session[SessionInfo.C_Session_sessioninfo]; return(sessionInfo.GetAllCmd()); }