title: Linq 2 Sql - How to design proper repository, controller and view-model flow with entity inheritance
body: <p>Question:  I'm wondering what type of Repository and Controller design/work-flow people implement when using entity inheritance in a ORM, in this case LINQ 2 SQL with MVC .NET.  </p>
  
  <p>I have a very simple hierarchy where a Clothing class (concrete) inherits from Product (abstract class).  However, this complicates the design quite a bit.  It would be foolish to make a repository class per concrete implementation of Product, so I use Product as a parameter type and return type in my 'Product' repository. "However, because of this I must cast the Product type to a concrete implementation of Product (either before requesting from the repository or after).</p>
  
  <p>Another thing I noticed is that  even if I determine the correct type to cast to, I have to define my view-models to pass to my view for each concrete implementation of Product.</p>
  
  <p>If this is what needs to be done, so be it, but I'm interested what other people's thoughts and/or experience are.</p>