Example #1
0
 public static IJourney MapFromDto(Dto.Journey dto)
 {
     return(new Journey
     {
         Id = dto.Id,
         Distance = dto.Distance,
         StartLocation = (Location)LocationRepo.MapFromDto(dto.StartLocation),
         EndLocation = (Location)LocationRepo.MapFromDto(dto.EndLocation)
     });
 }
Example #2
0
        public Dto.Journey MapToDto(IJourney journey)
        {
            using (MilesDb db = new MilesDb())
            {
                var dto = new Dto.Journey
                {
                    Id            = journey.Id,
                    Distance      = journey.Distance,
                    StartLocation = LocationRepo.MapToDto(journey.StartLocation),
                    EndLocation   = LocationRepo.MapToDto(journey.EndLocation)
                };

                return(dto);
            }
        }