public void Create(Timetable timetable) { try { var mapTimetable = AutoMapper.Mapper.Map <Data.Entities.Timetable>(timetable); _timetrableRepository.Add(mapTimetable); _unitOfWork.Commit(); } catch (Exception exception) { throw new FaultException(exception.Message); } }
public void Update(Timetable timetable) { try { var mapTimetable = AutoMapper.Mapper.Map <Data.Entities.Timetable>(timetable); var actualTimetable = _timetrableRepository .FindBy(t => t.Id == mapTimetable.Id) .First(); actualTimetable.BusStopOnLineId = mapTimetable.BusStopOnLineId; actualTimetable.DepartureTime = mapTimetable.DepartureTime; _unitOfWork.Commit(); } catch (Exception exception) { throw new FaultException(exception.Message); } }