public async void Test1()
        {
            PropertyListingRequest propertyListingRequest = new PropertyListingRequest();
            var response = await _propertyListingBusiness.GetListing(propertyListingRequest);

            Assert.True(response.Items.Count() > 0 && response.Items.Count() == propertyListingRequest.Take.GetValueOrDefault());
        }
Esempio n. 2
0
        public async Task <ActionResult <PropertyListingResponse> > GetListings([FromQuery] PropertyListingRequest request)
        {
            //Put Validation here (if required) and Send a Bad Request

            //Create logs here
            try
            {
                var result = await _listingBL.GetListing(request);

                if (result.Items != null)
                {
                    return(Ok(result));
                }
                else
                {
                    return(NotFound("Some Error Occured, Please contact Admin for more information"));
                }
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }