public void Create(BusStopOnLine busStopOnLine) { try { var mapBusStopOnLine = AutoMapper.Mapper.Map <Data.Entities.BusStopOnLine>(busStopOnLine); _busStopOnLineRepository.Add(mapBusStopOnLine); _unitOfWork.Commit(); } catch (Exception exception) { throw new FaultException(exception.Message); } }
public void Update(BusStopOnLine busStopOnLine) { try { var actualBusStopOnLine = _busStopOnLineRepository .FindBy(b => b.Id == busStopOnLine.Id) .First(); actualBusStopOnLine.BusStopId = busStopOnLine.BusStopId; actualBusStopOnLine.Direction = busStopOnLine.Direction; actualBusStopOnLine.LineId = busStopOnLine.LineId; actualBusStopOnLine.NumberStopOnLine = busStopOnLine.NumberStopOnLine; _unitOfWork.Commit(); } catch (Exception exception) { throw new FaultException(exception.Message); } }