public ClassLevelViewModel UpdateClassLevel(int id, ClassLevelViewModel classLevel) { var originalClassLevel = _classProgressionRepository.GetById(id); ClassLevelMapper.MapModelToEntity(classLevel, originalClassLevel); originalClassLevel.ModifiedBy = "TEST"; var updatedClassLevel = _classProgressionRepository.Update(originalClassLevel); return ClassLevelMapper.MapEntityToModel(updatedClassLevel); }
public ClassLevelViewModel AddClassLevel(ClassLevelViewModel classLevel) { var classLevelEntity = ClassLevelMapper.MapModelToEntity(classLevel); classLevelEntity.CreatedBy = "TEST"; classLevelEntity.SeedData = false; var addedClassLevel = _classProgressionRepository.Add(classLevelEntity); return ClassLevelMapper.MapEntityToModel(addedClassLevel); }
public static void MapModelToEntity(ClassLevelViewModel classLevel, ClassProgression classProgressionEntity) { Mapper.Map(classLevel, classProgressionEntity); }
public static ClassProgression MapModelToEntity(ClassLevelViewModel classLevel) { return Mapper.Map<ClassProgression>(classLevel); }