I used to implement my repository classes as you can see below
public Class MyRepository { private MyDbContext _context; public MyRepository(My
Second approach (using) is better as it surely holds the connection only for the minimum needed time and is easier to make thread-safe.