public UnitOfWork(PetStoreContext context) { _context = context; UserAddress = new UserAddressRepository(_context); Products = new ProductRepository(_context); Orders = new OrderRepository(_context); OrderItems = new OrderItemRepository(_context); ShoppingCarts = new ShoppingCartRepository(_context); ShoppingCartItems = new ShoppingCartItemRepository(_context); Pets = new PetRepository(_context); PetTypes = new PetTypeRepository(_context); }
static void Main(string[] args) { IPetRepository petRepository = new PetRepository(); IPetTypeRepository petTypeRepository = new PetTypeRepository(); IOwnerRepository ownerRepository = new OwnerRepository(); IPetService petService = new PetService(petRepository, ownerRepository, petTypeRepository); IOwnerService ownerService = new OwnerService(ownerRepository, petRepository); FakeDB.InitData(); Printer print = new Printer(petService, ownerService); print.PrintMenu(); }