コード例 #1
0
ファイル: MatchHelper.cs プロジェクト: hmx-world/backend-repo
        public async Task <IEnumerable <CommercialPropertyIndex> > MatchCommercialRentalPropertyByFirm(int firmId, CommercialQuery query)
        {
            var propertyList = await _manager.GetActiveIndustrialPropertyByProvider(firmId);

            var result = _match.MatchCommercialProperty(query, Purpose.Rent, propertyList);

            string stringQuery = $"Number of rooms: {query.NumberOfRooms}. max price: {query.maxPrice}, min price: {query.minPrice}";
            string location    = $"{query.City}, {query.State}";

            _manager.AddSearchQueryToLog(stringQuery, location, firmId, PropertyType.Rental, result.Count, 0);

            return(result.OrderByDescending(m => m.Rank));
        }
コード例 #2
0
        public async Task <IActionResult> GetIndustrialPropertyByProvider([FromRoute] int?firmId)
        {
            if (firmId == null)
            {
                return(BadRequest("provide a firm id"));
            }
            var result = await _manager.GetActiveIndustrialPropertyByProvider((int)firmId);

            if (result == null)
            {
                return(NotFound());
            }

            return(Ok(result));
        }