Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 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();
 }