示例#1
0
        public async Task <IActionResult> GetHotelsByCityCode([FromBody] string cityCode)
        {
            var hotelsData = await iHotel.GetAllHotelsByCityId(cityCode).ConfigureAwait(false);

            if (hotelsData.IsError)
            {
                return(new StatusCodeResult(500));
            }
            else if (!hotelsData.Result.Any())
            {
                return(NoContent()); //204
            }

            return(Ok(hotelsData));
        }