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); }
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); }
// GET: People/Create public IActionResult Create() { ViewData["OrganizationId"] = new SelectList(_context.Set <Organization>(), "Id", "Name"); return(View()); }