コード例 #1
0
 public SearchInput ToDomain(SearchInputDTO searchInput)
 {
     return(new SearchInput()
     {
         StartStop = _stopRepository.Find(searchInput.StartStopId),
         DestinationStop = _stopRepository.Find(searchInput.DestinationStopId),
         StartTime = searchInput.StartTime,
         StartDate = searchInput.StartDate,
     });
 }
コード例 #2
0
ファイル: StopValidator.cs プロジェクト: mchilicki/commline
 public bool ValidateEdit(StopDTO stop)
 {
     Validate(stop);
     if (!_stopRepository.DoesStopWithIdExist(stop.Id))
     {
         throw new ArgumentException(ValidationResources.StopDoesntExist);
     }
     if (_stopRepository.Find(stop.Id).StopType != stop.StopType &&
         _stopRepository.IsStopConnectedToAnyLine(stop.Id))
     {
         throw new ArgumentException(ValidationResources.StopTypeCannotBeEditedWhenItsInPreviousTypeLine);
     }
     return(true);
 }
コード例 #3
0
ファイル: StopManager.cs プロジェクト: mchilicki/commline
        public StopDTO GetById(long id)
        {
            var stopDTO = Mapper.Map <Stop, StopDTO>(_stopRepository.Find(id));

            return(stopDTO);
        }