protected virtual void Dispose(bool disposing) { if (disposing) { // Free managed resources if (productRepository != null) { productRepository.Dispose(); productRepository = null; } if (saleModalityProductRepository != null) { saleModalityProductRepository.Dispose(); saleModalityProductRepository = null; } if (productDocumentService != null) { productDocumentService.Dispose(); productDocumentService = null; } if (customerProductRepository != null) { customerProductRepository.Dispose(); customerProductRepository = null; } if (saleModalityProductMarginRepository != null) { saleModalityProductMarginRepository.Dispose(); saleModalityProductMarginRepository = null; } } }
public ProductService( IProductRepository productRepo, ISaleModalityProductRepository saleModalityProductRepo, IProductDocumentService productDocumentServ, ICustomerProductRepository customerProductRepo, ISaleModalityProductMarginRepository saleModalityProductMarginRepo) { productRepository = productRepo; saleModalityProductRepository = saleModalityProductRepo; productDocumentService = productDocumentServ; customerProductRepository = customerProductRepo; saleModalityProductMarginRepository = saleModalityProductMarginRepo; }