Exemple #1
0
        public async Task <IActionResult> MatchResidentialPropertyByFirm([FromRoute] int firmId, [FromBody] UserQuery query)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            else
            {
                switch (query.purpose)
                {
                case Purpose.Rent:
                    return(Ok(await _matchHelper.MatchRentalPropertyByFirm(firmId, query)));

                case Purpose.Sale:
                    return(Ok(await _matchHelper.MatchOnSalePropertyByFirm(firmId, query)));

                default:
                    return(Ok(await _matchHelper.MatchRentalPropertyByFirm(firmId, query)));
                }
            }
        }