public VacationModel MapData(Aug2015Backend.Entities.Vacation v) { VacationModel mappedVacation = new VacationModel(); if (v != null) { mappedVacation.Pictures = pictureAdapter.MapData(v.Picture); mappedVacation.Cover = pictureAdapter.MapData(v.Cover); mappedVacation.PromoText = v.PromoText; mappedVacation.ContactInformation = contactInformationAdapter.MapData(v.ContactInformation); mappedVacation.Included = itemAdapter.MapData(v.Included); mappedVacation.Cost = priceAdapter.MapData(v.Cost); mappedVacation.NumberOfParticipants = v.NumberOfParticipants; mappedVacation.Location = locationAdapter.MapData(v.Location); mappedVacation.When = periodAdapter.MapData(v.When); ICollection<CommentModel> comments = commentAdapter.MapData(v.Comment); mappedVacation.Comment = comments; mappedVacation.Leeftijd = arAdapter.MapData(v.AgeRange); mappedVacation.Titel = v.Titel; mappedVacation.Id = v.Id; mappedVacation.Tax_Benefit = v.Tax_Benefit; } return mappedVacation; }
public AgeRangeModel MapData(Aug2015Backend.Entities.AgeRange ar) { AgeRangeModel mappedAgeRange = new AgeRangeModel(); if (ar != null) { mappedAgeRange.Id = ar.Id; mappedAgeRange.Min_leeftijd = ar.Min_leeftijd; mappedAgeRange.Max_leeftijd = ar.Max_leeftijd; mappedAgeRange.VacationId = ar.Vacation.Id; } return mappedAgeRange; }