public ProductService(IMessageRepositoryFactory messageRepositoryFactory, IProductRepositoryFactory productRepositoryFactory) { if (messageRepositoryFactory == null) throw new ArgumentNullException("MessageRepositoryFactory"); if (productRepositoryFactory == null) throw new ArgumentNullException("ProductRepositoryFactory"); _messageRepositoryFactory = messageRepositoryFactory; _productRepositoryFactory = productRepositoryFactory; _messageRepository = _messageRepositoryFactory.Create(); _productRepository = _productRepositoryFactory.Create(); }
public ProductService(IMessageRepositoryFactory messageRepositoryFactory, IProductRepositoryFactory productRepositoryFactory) { if (messageRepositoryFactory == null) { throw new ArgumentNullException("MessageRepositoryFactory"); } if (productRepositoryFactory == null) { throw new ArgumentNullException("ProductRepositoryFactory"); } _messageRepositoryFactory = messageRepositoryFactory; _productRepositoryFactory = productRepositoryFactory; _messageRepository = _messageRepositoryFactory.Create(); _productRepository = _productRepositoryFactory.Create(); }