Пример #1
0
 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);
 }
Пример #2
0
        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;
        }
Пример #3
0
 public ProductRepository(SimpleStoreEntities context)
     : base(context)
 {
 }
 public OrderRepository(SimpleStoreEntities context)
     : base(context)
 {
 }
 public ShoppingCardRepository(SimpleStoreEntities context)
     : base(context)
 {
 }
Пример #6
0
 public CategoryRepository(SimpleStoreEntities context)
     : base(context)
 {
 }