//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(); }
public CustomerRepository(CustomerProjectContext context) { _context = context; }