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