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))); }
public IEnumerable <BillModel> GetBillsByCategory(int categoryId) { return(billsService.GetBillsByCategory(categoryId)); }