Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        public IActionResult Details(int id)
        {
            var laptop = LaptopRepository.GetSingleLaptop(id);

            return(View(laptop));
        }
Ejemplo n.º 4
0
        public IActionResult Index()
        {
            var laptops = LaptopRepository.GetAll();

            return(View(laptops));
        }
 public LaptopController()
 {
     laptop = new LaptopRepository();
 }