Пример #1
0
 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);
 }
Пример #2
0
 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);
 }
Пример #3
0
 public static void MapModelToEntity(ClassLevelViewModel classLevel, ClassProgression classProgressionEntity)
 {
     Mapper.Map(classLevel, classProgressionEntity);
 }
Пример #4
0
 public static ClassProgression MapModelToEntity(ClassLevelViewModel classLevel)
 {
     return Mapper.Map<ClassProgression>(classLevel);
 }