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); }
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)); }