public List<Skill> MapSkillModelsToSkills(List<SkillModel> skillModels) { if(skillModels == null) { return new List<Skill>(); } else { var skills = new List<Skill>(); foreach (var skillModel in skillModels) { var skill = new Skill(skillModel.Name, skillModel.Level); skills.Add(skill); } return skills; } }
private List<Skill> GenerateSkillList(Random random) { var numberOfSkills = random.Next(1, 11); var shuffledSkills = _skillNames.OrderBy(r => random.Next()); var skillSubsequence = shuffledSkills.Take(numberOfSkills); var skillList = new List<Skill>(); foreach (var skillName in skillSubsequence) { var skill = new Skill(skillName, random.Next(1, 11)); skillList.Add(skill); } return skillList; }