public UnitOfWork(SimpleStoreEntities context) { _context = context; Categories = new CategoryRepository(_context); Products = new ProductRepository(_context); Orders = new OrderRepository(_context); ShoppingCard = new ShoppingCardRepository(_context); Users = new UserRepository(_context); }
public SimpleStoreFormsAppMainForm() { InitializeComponent(); // don't forget to include a using statement context = new SimpleStoreEntities(); // register the event handlers this.Load += SimpleStoreMainForm_Load; buttonUpdate.Click += ButtonUpdate_Click; // when form closed, close database too this.FormClosed += SimpleStoreFormsAppMainForm_FormClosed; }
public ProductRepository(SimpleStoreEntities context) : base(context) { }
public OrderRepository(SimpleStoreEntities context) : base(context) { }
public ShoppingCardRepository(SimpleStoreEntities context) : base(context) { }
public CategoryRepository(SimpleStoreEntities context) : base(context) { }