Esempio n. 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);
 }
Esempio n. 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);
 }
Esempio n. 3
0
 public CarRepository(JPartsContext context) : base(context)
 {
 }
Esempio n. 4
0
 public PartsOrdersRepository(JPartsContext context) : base(context)
 {
 }
 public AddressRepository(JPartsContext context) : base(context)
 {
 }
Esempio n. 6
0
 public Repository(JPartsContext context)
 {
     Context = context;
 }
 public ClientRepository(JPartsContext context) : base(context)
 {
 }
 public ShopRepository(JPartsContext context) : base(context)
 {
 }