Пример #1
0
 public UnitOfWork(JPartsContext context)
 {
     _context  = context;
     Addresses = new AddressRepository(_context);
     Cars      = new CarRepository(_context);
     Clients   = new ClientRepository(_context);
     Orders    = new OrderRepository(_context);
     Parts     = new PartRepository(_context);
     Shops     = new ShopRepository(_context);
 }
Пример #2
0
 protected override void OnStartup(StartupEventArgs e)
 {
     using (JPartsContext Context = new JPartsContext())
     {
         Context.Database.EnsureCreated();
         UnitOfWork.UnitOfWork uoW = new UnitOfWork.UnitOfWork(Context);
         if (uoW.Clients.GetByUsername("admin") == null)
         {
             AuthenticationService authenticationService = new AuthenticationService(uoW);
             authenticationService.Register("admin", "admin", "+375291111111", 1, 1, "Street1", "Minsk", "*****@*****.**", "admin", "admin", "admin", true);
         }
     }
     base.OnStartup(e);
 }
Пример #3
0
 public CarRepository(JPartsContext context) : base(context)
 {
 }
Пример #4
0
 public PartsOrdersRepository(JPartsContext context) : base(context)
 {
 }
 public AddressRepository(JPartsContext context) : base(context)
 {
 }
Пример #6
0
 public Repository(JPartsContext context)
 {
     Context = context;
 }
Пример #7
0
 public ClientRepository(JPartsContext context) : base(context)
 {
 }
Пример #8
0
 public ShopRepository(JPartsContext context) : base(context)
 {
 }