public ExperienceDto UpdateExperience(ExperienceDto experienceDto) { if (experienceDto.Id <= 0) { return(null); } var experience = experienceDto.ToEntity(); var updated = _experienceDao.Update(experience); _experienceDao.Commit(); return(updated.ToDto()); }
public string CreateExperience(ExperienceDto experienceDto) { string returnMessage; var experience = experienceDto.ToEntity(); if (experience.Id > 0) { _experienceDao.Update(experience); returnMessage = "Work updated"; } else { _experienceDao.Create(experience); returnMessage = "Work created"; } _experienceDao.Commit(); return(returnMessage); }