public void AddSkill(Skill skill, short level) { var requiredSkill = new ProjectRequiredSkill { Project = this, ProjectId = Id, Skill = skill, SkillId = skill.Id, Level = level }; var index = SkillsToDelete.IndexOf(s => s == requiredSkill); if (index == -1) { SkillsToAdd.Add(requiredSkill); } else { SkillsToDelete.RemoveAt(index); } }
public void AddSkill(Skill skill, short level) { var employeeSkill = new EmployeeSkill { Employee = this, EmployeeId = Id, Skill = skill, SkillId = skill.Id, Level = level }; var index = SkillsToDelete.IndexOf(s => s == employeeSkill); if (index == -1) { SkillsToAdd.Add(employeeSkill); } else { SkillsToDelete.RemoveAt(index); } }