Suppose my repository class looks like this:
class myRepository : IDisposable{
private DataContext _context;
public myRepository(DataContext context){
Does this mean that I should not be implementing the IDisposable on the repository to clean up the DataContext?
It sounds like it - from what you're saying, all repositories will share the same DataContext
, but the first repository you create will dispose of it.
What creates the DataContext
? Whatever that is, it should dispose of it.