Beispiel #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);
 }
Beispiel #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);
 }
Beispiel #3
0
 public static void MapModelToEntity(SkillViewModel skill, Skill skillEntity)
 {
     Mapper.Map(skill, skillEntity);
 }
Beispiel #4
0
 public static Skill MapModelToEntity(SkillViewModel skill)
 {
     return Mapper.Map<Skill>(skill);
 }