public List <Listing> GetListingsByRentCost(ListingsSearchRequest model) { List <Listing> list = null; DataProvider.ExecuteCmd(GetConnection, "dbo.Listings_SearchByRentCost" , inputParamMapper : delegate(SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@max", model.Max); paramCollection.AddWithValue("@min", model.Min); } , map : delegate(IDataReader reader, short set) { Listing p = new Listing(); MapListing <Listing>(reader); if (list == null) { list = new List <Listing>(); } list.Add(p); } ); return(list); }
public HttpResponseMessage GetSearchByLeaseTerms(ListingsSearchRequest model) { if (!ModelState.IsValid) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } ItemsResponse <Listing> response = new ItemsResponse <Listing>(); response.Items = _listingService.GetListingsByLeaseTerms(model); return(Request.CreateResponse(response)); }