예제 #1
0
        public IHttpActionResult GetBillsByCategory(int categoryId)
        {
            //CategoryModel category = db.CategoriesRepository.GetByID(categoryId);
            //if (category == null)
            //{
            //    return NotFound();
            //}

            //List<OfferModel> offers = category.offerModels.ToList();
            //List<BillModel> bills = new List<BillModel>();

            //foreach (var offer in offers)
            //{
            //    bills.AddRange(offer.billModels);
            //}

            //return Ok(bills);
            return(Ok(billService.GetBillsByCategory(categoryId)));
        }
예제 #2
0
 public IEnumerable <BillModel> GetBillsByCategory(int categoryId)
 {
     return(billsService.GetBillsByCategory(categoryId));
 }