public void Update(RepairPlaceDTO repairPlaceDTO) { RepairPlace repairPlace = Mapper.Map <RepairPlace>(repairPlaceDTO); _unitOfWork.RepairPlaces.Update(repairPlace); _unitOfWork.Save(); }
public void Add(RepairPlaceDTO repairPlaceDTO) { RepairPlace repairPlace = Mapper.Map <RepairPlace>(repairPlaceDTO); repairPlace.Id = Guid.NewGuid(); _unitOfWork.RepairPlaces.Create(repairPlace); _unitOfWork.Save(); }
public void Delete(Guid id) { if (HasRelations(id)) { throw new HasRelationsException(); } RepairPlace repairPlace = _unitOfWork.RepairPlaces.Get(id); if (repairPlace == null) { throw new NotFoundException(); } _unitOfWork.RepairPlaces.Delete(id); _unitOfWork.Save(); }
public RepairPlaceDTO Get(Guid id) { RepairPlace repairPlace = _unitOfWork.RepairPlaces.Get(id); return(Mapper.Map <RepairPlaceDTO>(repairPlace)); }