public async Task <BaseResponse <List <YachtSimilarItem> > > SearchSimilar(YachtSimilarSearchModel searchModel) { try { string url = _baseYatchApiUrl + _yachtPortalApiUrl.Yatchs.SearchSimilar; string paramater = ConvertToUrlParameter(searchModel); url = url + paramater; var response = await _apiExcute.GetData <List <YachtSimilarItem> >(url, null); return(response); } catch (Exception ex) { return(BaseResponse <List <YachtSimilarItem> > .InternalServerError(message : ex.Message, fullMsg : ex.StackTrace)); } }
public async Task <IActionResult> YachtSearchSimilarResult(string yachtId, string country, YachtSimilarSearchModel searchModel) { searchModel.ExcludeYachtID = Convert.ToInt32(Terminator.Decrypt(yachtId)); var yatchApiResponse = await _yatchService.SearchSimilar(searchModel); var responseData = yatchApiResponse.GetDataResponse(); var searchModelPass = new YachtSearchModel { CheckIn = searchModel.CheckIn, CheckOut = searchModel.CheckOut, City = searchModel.City, Passengers = searchModel.NumOfPassenger, Country = country }; foreach (var item in responseData) { await PreparingYachtCustomProperties(item); PreparingYachtLink(item, searchModelPass); } return(Ok(responseData)); }
public IActionResult SearchSimilarYacht([FromQuery] YachtSimilarSearchModel searchModel) { var result = _yachtService.YachtSearchSimilarStoreProcedure(searchModel); return(Ok(result)); }