예제 #1
0
        public async Task <IEnumerable <Skill> > GetAllSkillsWithTags()
        {
            var skills = _context.Set <Skill>()
                         .Include(s => s.Tags)
                         .ThenInclude(skillTag => skillTag.Tag);

            return(await skills.ToListAsync());
        }
        public async Task <SkillsMetadata> Get()
        {
            var skillLevels = await _context.Set <SkillLevel>().ToListAsync();

            var timePeriods = await _context.Set <TimePeriod>().ToListAsync();

            var skillsMetadata = new SkillsMetadata
            {
                SkillLevels = skillLevels,
                TimePeriods = timePeriods
            };

            return(skillsMetadata);
        }
예제 #3
0
        public async Task <Person> GetPersonWithSkills(int personId)
        {
            var person = await _context.Set <Person>()
                         .Include(p => p.Skills).ThenInclude(personSkills => personSkills.Skill)
                         .ThenInclude(skill => skill.Tags).ThenInclude(tag => tag.Tag)
                         .Include(p => p.Skills).ThenInclude(personSkills => personSkills.TimeUsed)
                         //.ThenInclude(t=> t.Description)
                         .Include(p => p.Skills).ThenInclude(personSkills => personSkills.TimeSinceUsed)
                         //.ThenInclude(t=> t.Description)
                         .Include(p => p.Skills).ThenInclude(personSkills => personSkills.SkillLevel)
                         //.ThenInclude(t=> t.Description)
                         .FirstOrDefaultAsync(x => x.Id == personId);

            return(person);
        }
예제 #4
0
 // GET: People/Create
 public IActionResult Create()
 {
     ViewData["OrganizationId"] = new SelectList(_context.Set <Organization>(), "Id", "Name");
     return(View());
 }