title: Entity Framework Caching with the Repository Pattern
body: <p>If I want to implement caching when I am using the repository pattern and the Entity Framework, couldn't I just do some simple logic outside of the Entity Framework to handle the caching?</p>
  
  <p>E.g. </p>
  
  <pre><code>if(Cache[ProductsKey] != null)
  {
      return ConvertToProducts(Cache[ProductsKey]);
  }
  else
  {
      var products = repository.Products;
      Cache[ProductsKey] =  products;
      return products;
  }
  </code></pre>
  
  <p>It seems like a lot of people are over-complicating this. Or is doing it this way going to be limiting in some way?</p>