Example #1
0
        //private static DbContextOptions<CustomerProjectContext> optionsStatic;

        public UnitOfWork(DbOptions opt)
        {
            context = new CustomerProjectContext();

            CustomerRepository = new CustomerRepository(context);
            OrderRepository    = new OrderRepository(context);
            CartRepository     = new CartRepository(context);
            CartItemRepository = new CartItemRepository(context);
            ProductRepository  = new ProductRepository(context);
            UserRepository     = new UserRepository(context);

            context.Database.EnsureCreated();
        }
Example #2
0
 public CustomerRepository(CustomerProjectContext context)
 {
     _context = context;
 }