public UnitOfWork(ApplicationDbContext context) { _context = context; Laptop = new LaptopRepository(context); Cart = new CartRepository(context); CartDetail = new CartDetailRepository(context); Promotion = new PromotionRepository(context); User = new UserRepository(context); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var studentRepository = new StudentRepository("student"); var roomRepository = new RoomRepository("room"); var laptopRepository = new LaptopRepository("laptop"); var view = new DormitoryForm(); var studentPresenter = new StudentPresenter(view, studentRepository); var roomPresenter = new RoomPresenter(view, roomRepository); var laptopPresenter = new LaptopPresenter(view, laptopRepository); Application.Run(view); }
public IActionResult Details(int id) { var laptop = LaptopRepository.GetSingleLaptop(id); return(View(laptop)); }
public IActionResult Index() { var laptops = LaptopRepository.GetAll(); return(View(laptops)); }
public LaptopController() { laptop = new LaptopRepository(); }