コード例 #1
0
        public BaseResponse <List <Food> > GetByProducts([FromBody] List <int> productIds)
        {
            BaseResponse <List <Food> > response = null;

            try
            {
                string token = Request.Headers["Auth"];
                int    start = int.Parse(Request.Query["start"]);
                int    size  = int.Parse(Request.Query["size"]);

                List <Food> foods = businessLogicLayer.FindFoodsByProducts(token, start, size, productIds);
                response = new BaseResponse <List <Food> >(foods);
            }
            catch (Exception ex)
            {
                response = new BaseResponse <List <Food> > {
                    Error = ex.Message
                };
            }
            return(response);
        }