Example #1
0
        //記帳分類
        public async Task <IActionResult> GetCategorys()
        {
            List <Categorys> list = new List <Categorys>();

            if (HttpContext.Session.GetObjectFromJson <List <Categorys> >("categoryList") == null)
            {
                list = await _costService.GetCategorys();

                HttpContext.Session.SetObjectAsJson("categoryList", list);
            }
            else
            {
                list = HttpContext.Session.GetObjectFromJson <List <Categorys> >("categoryList");
            }

            return(Ok(list));
        }