title: Generic Repository vs. ObjectSet
body: <p>There seems to be a common agreement in the blogosphere, that one of the great features of the Entity Framework 4 is the ability to create generic repositories on top of the generic ObjectSets. Example implementations of generic repositories are basically wrappers around an ObjectSet, that simply translate method calls. There is no meaningful logic going on. After some thinking I have come to the point where I was asking myself: What benefits does a generic repository give me, that the ObjectSet itself doesn't already provide? The ObjectSet has all the required functionality (CRUD). Since it implements IEnumerable (and even IQueryable) it offers all the Linq extensions that make it very easy to specify exactly what data you want. What exactly justifies going the detour via some IRepository, as opposed to simply using the IObjectSet directly as my interface for the data access layer?</p>
  
  <p>Thanks and regards,</p>
  
  <p>Peter.</p>