Пример #1
0
        public static Trip UpdateEntityFromModel(Trip trip, TripDTO tripModel)
        {
            var tripResult = GenericMapper.UpdateEntityFromModel <Trip, TripDTO>(trip, tripModel);

            if (tripResult.TripStops == null)
            {
                tripResult.TripStops = new List <TripStop>();
            }

            foreach (var stop in tripModel.Stops)
            {
                tripResult.TripStops.Add(GenericMapper.ConvertModelToEntity <TripStop, TripStopDTO>(stop));
            }

            return(trip);
        }
Пример #2
0
 public static Trip ConvertModelToEntity(TripDTO tripModel)
 {
     return(GenericMapper.ConvertModelToEntity <Trip, TripDTO>(tripModel));
 }
Пример #3
0
 public static TripDTO ConvertEntityToModel(Trip trip)
 {
     return(GenericMapper.ConvertEntityToModel <Trip, TripDTO>(trip));
 }