public IHttpActionResult GetByCityId_Authenticate(HotelsRequestModel model) { if (_isRateLimitApplied) { return(Content(HttpStatusCode.MethodNotAllowed, ApplicationConstant.RATE_LIMIT_APPLIED)); } if (!ModelState.IsValid) { return(Content(HttpStatusCode.BadRequest, ModelState)); } HotelsResponse response = new HotelsResponse(); try { var res = HotelsProvider.GetHotelsByCityId(model, out int totalRecordCount); response.Response = res; response.TotalRecordCount = totalRecordCount; if (totalRecordCount != 0) { response.Successful = true; response.ResponseCode = ResponseCode.Success; } else { response.Successful = false; response.ResponseCode = ResponseCode.Fail; } return(Ok(response)); } catch (Exception ex) { //Log exception in db Debug.WriteLine(string.Format("Error {0}", ex.Message)); return(Content(HttpStatusCode.InternalServerError, ModelState)); } }
private void ReceiveHotelsResponse(HotelsResponse response) { PutResult(response); }