Ejemplo n.º 1
0
        static IUnitOfWork CreateUnitOfWork(IVivesRentalDbContext context)
        {
            var productRepository   = new ProductRepository(context);
            var articleRepository   = new ArticleRepository(context);
            var orderRepository     = new OrderRepository(context);
            var orderLineRepository = new OrderLineRepository(context);
            var customerRepository  = new CustomerRepository(context);

            return(new UnitOfWork(context, productRepository, articleRepository, orderRepository, orderLineRepository, customerRepository));
        }
Ejemplo n.º 2
0
 public UnitOfWork(IVivesRentalDbContext context,
                   IProductRepository productRepository,
                   IArticleRepository articleRepository,
                   IOrderRepository orderRepository,
                   IOrderLineRepository orderLineRepository,
                   ICustomerRepository customerRepository)
 {
     _context   = context;
     Products   = productRepository;
     Articles   = articleRepository;
     Orders     = orderRepository;
     OrderLines = orderLineRepository;
     Customers  = customerRepository;
 }
Ejemplo n.º 3
0
 public ArticleRepository(IVivesRentalDbContext context)
 {
     _context = context;
 }
 public OrderLineRepository(IVivesRentalDbContext context)
 {
     _context = context;
 }
Ejemplo n.º 5
0
 public CustomerRepository(IVivesRentalDbContext context)
 {
     _context = context;
 }
Ejemplo n.º 6
0
 public ProductRepository(IVivesRentalDbContext context)
 {
     _context = context;
 }