private static void CreateNewLanguageSkills(Candidate destination, CandidateDTO source) { source.LanguageSkills.Where(x => x.IsNew()).ToList().ForEach(newLanguageSkill => { var toDomain = new LanguageSkill(); toDomain.Update(newLanguageSkill); destination.LanguageSkills.Add(toDomain); }); }
private static void PerformLanguageSkillsSaving(Vacancy destination, VacancyDTO source, ILanguageSkillRepository languageSkillRepository) { var updatedLanguageSkill = source.LanguageSkill; LanguageSkill domainLanguageSkill = destination.LanguageSkill; if (destination.LanguageSkill == null) { domainLanguageSkill = destination.LanguageSkill = new LanguageSkill(); } if (updatedLanguageSkill == null) { destination.LanguageSkill = null; return; } if (updatedLanguageSkill.ShouldBeRemoved()) { languageSkillRepository.Delete(updatedLanguageSkill.Id); } else { domainLanguageSkill.Update(updatedLanguageSkill); } }