title: ASP.NET MVC Pattern - How to use two seperate repositores in a controller(using DI)
body: <p>I have two very simple tables.  Product and ProductCategory (ProductCategory is like a 'lookup' table for Product).  On my controller, for my Index() method I want to list the categories of the products.  When the user clicks on a category, I want to pass my category to my List() method to show all the products of a specific category.</p>
  
  <p>I'm using ninject DI framework; I currently have something like this.</p>
  
  <pre><code>private IProductCategory productCategoryRepository;
  private IProduct productRepository;
  
  public StoreController(IProductCategory productCategoryRepository)
  {
      this.productCategoryRepository = productCategoryRepository;
  }
  
  public ViewResult Index()
  {
      return View(productCategoryRepository.GetCategories());
  }
  
    public ViewResult List(string category, int page = 1) //Use default value
    {
        ...
    };
  </code></pre>
  
  <p>I have basic repositories per table/entity (i.e. GetCategories(), GetProducts(), GetProductsByCategory..etc.) What's the best way...or how can I use two seperate repositories in a controller?  I'd prefer not to pass them both through a controller.</p>
  
  <p>Note:  Product and ProductCategory is not considered an aggregate.</p>