コード例 #1
0
        public IActionResult GetSkillbook(int jobId)
        {
            SkillBook book = SkillFactory.GetSkillBook(jobId);

            if (book == null)
            {
                return(NotFound());
            }
            return(Json(book));
        }
コード例 #2
0
        public IActionResult GetSkillFromBook(int jobId, int skillId)
        {
            SkillBook book = SkillFactory.GetSkillBook(jobId);

            if (book == null)
            {
                return(NotFound("Couldn't find skillbook"));
            }
            Skill skill = book.Skills.Where(c => c.id == skillId).FirstOrDefault();

            if (skill == null)
            {
                return(NotFound("Couldn't find skill in book"));
            }
            return(Json(skill));
        }