1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class ProductService : IProductService
{
  private IProductRepository repo;
  public ProductService(IProductRepository repo)
  {
    this.repo = repo;
  }

  public IEnumerable<Product> GetAllCalculatedProducts(int categoryId)
  {
    var items = repo.GetAllProductsByCategoryId(categoryId);

    Calculator c = new Calculator(items);
    c.Calculate();

    Filter f = new Filter(c.Items);
    f.Filter();

    Sorter s = new Sorter(f.Items);
    s.Sort();

    return s.Items;
  }
}