示例#1
0
        public async Task <PlanDto> CreateAsync(CreatePlanInput input)
        {
            var planForm = input.CreatePlanForm();
            var result   = await _planManager.CreateAsync(planForm);

            await CurrentUnitOfWork.SaveChangesAsync();

            var dto = result.MapTo <PlanDto>();

            return(dto);
        }
示例#2
0
 public static PlanForm CreatePlanForm(this CreatePlanInput inputDto)
 {
     return(new PlanForm(inputDto.PlaceName, inputDto.PlaceId, inputDto.StartDate, inputDto.StartTime, inputDto.EndDate, inputDto.EndTime,
                         inputDto.Language, inputDto.HasAccomodationBooked, inputDto.AccomodationId, inputDto.PreferedTravelModes, inputDto.MaxWalkingKmsPerDay.Value, inputDto.DistanceTypePreference,
                         inputDto.PricePreference, inputDto.FoodPreference, inputDto.AverageSleep, inputDto.AtractionPopularityPreference, inputDto.AtractionDurationPreference, inputDto.SortedPlanElements, inputDto.PreferedPlanElements));
 }