Пример #1
0
        public IActionResult SearchForRestaurant([FromBody] SearchForRestaurant searchDetails)
        {
            IQueryable <RestaurantInformation> restaurantDetails;

            restaurantDetails = business_Repo.SearchForRestaurant(searchDetails);
            if (restaurantDetails != null)
            {
                return(this.Ok(restaurantDetails));
            }
            return(this.StatusCode((int)HttpStatusCode.InternalServerError, string.Empty));
        }
 public IActionResult SearchForRestaurant([FromBody] SearchForRestaurant searchDetails)
 {
     try
     {
         int UserId = (Request.Headers.ContainsKey("CustomerId") ? int.Parse(HttpContext.Request.Headers["CustomerId"]) : 0);
         loggerService.LogMessage("Received at endpoint : api/SearchForRestaurant : UserID : " + UserId);
         IQueryable <RestaurantInformation> restaurantDetails;
         restaurantDetails = business_Repo.SearchForRestaurant(searchDetails);
         if (restaurantDetails != null)
         {
             return(this.Ok(restaurantDetails));
         }
         return(this.StatusCode((int)HttpStatusCode.InternalServerError, string.Empty));
     }
     catch (Exception ex)
     {
         loggerService.LogException(ex);
         return(this.StatusCode((int)HttpStatusCode.InternalServerError, string.Empty));
     }
 }