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 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 GetClassLevelById(int id) { return(ClassLevelMapper.MapEntityToModel(_classProgressionRepository.GetById(id))); }