I am creating a ServiceLayer for my EntityFramework.
The service layer uses the Repositories which implements IDisposable. Since I am not implementing IDisposable in my Service class, should I use the Destructor to dispose object, or they will be automatically disposed by GC.
public class ProductService { private readonly ProductRepository _productRepository; public ProductService(ProductRepository repo) { _productRepository = repo; } ...... ...... ~ProductService() { _productRepositort.Dispose(); } }