예제 #1
0
 public SkillViewModel UdpateSkill(int id, SkillViewModel skill)
 {
     var skillToUpdate = _skillRepository.GetById(id);
     SkillMapper.MapModelToEntity(skill, skillToUpdate);
     skillToUpdate.ModifiedBy = "TEST";
     var updatedSkill = _skillRepository.Update(skillToUpdate);
     return SkillMapper.MapEntityToModel(updatedSkill);
 }
예제 #2
0
 public SkillViewModel AddSkill(SkillViewModel skill)
 {
     var skillToAdd = SkillMapper.MapModelToEntity(skill);
     skillToAdd.CreatedBy = "TEST";
     skillToAdd.SeedData = false;
     var addedSkill = _skillRepository.Add(skillToAdd);
     return SkillMapper.MapEntityToModel(addedSkill);
 }
예제 #3
0
 public static void MapModelToEntity(SkillViewModel skill, Skill skillEntity)
 {
     Mapper.Map(skill, skillEntity);
 }
예제 #4
0
 public static Skill MapModelToEntity(SkillViewModel skill)
 {
     return Mapper.Map<Skill>(skill);
 }