Beispiel #1
0
 public PowerViewModel UdpatePower(int id, PowerViewModel power)
 {
     var powerToUpdate = _powerRepository.GetById(id);
     PowerMapper.MapModelToEntity(power, powerToUpdate);
     powerToUpdate.ModifiedBy = "TEST";
     var updatedPower = _powerRepository.Update(powerToUpdate);
     return PowerMapper.MapEntityToModel(updatedPower);
 }
Beispiel #2
0
 public PowerViewModel AddPower(PowerViewModel power)
 {
     var newPower = PowerMapper.MapModelToEntity(power);
     newPower.CreatedBy = "TEST";
     newPower.SeedData = false;
     var addedPower = _powerRepository.Add(newPower);
     return PowerMapper.MapEntityToModel(addedPower);
 }
Beispiel #3
0
 public static void MapModelToEntity(PowerViewModel power, Power powerEntity)
 {
     Mapper.Map(power, powerEntity);
 }
Beispiel #4
0
 public static Power MapModelToEntity(PowerViewModel power)
 {
     return Mapper.Map<Power>(power);
 }