public async Task <IActionResult> MatchCommercialPropertyByFirm([FromRoute] int firmId, [FromBody] CommercialQuery query) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } else { switch (query.purpose) { case Purpose.Rent: return(Ok(await _matchHelper.MatchCommercialRentalPropertyByFirm(firmId, query))); case Purpose.Sale: return(Ok(await _matchHelper.MatchCommercialSalePropertyByFirm(firmId, query))); default: return(Ok(await _matchHelper.MatchCommercialRentalPropertyByFirm(firmId, query))); } } }