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); }
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); }
public CarRepository(JPartsContext context) : base(context) { }
public PartsOrdersRepository(JPartsContext context) : base(context) { }
public AddressRepository(JPartsContext context) : base(context) { }
public Repository(JPartsContext context) { Context = context; }
public ClientRepository(JPartsContext context) : base(context) { }
public ShopRepository(JPartsContext context) : base(context) { }