public UnitOfWork(SportyContext db)
        {
            this.db  = db;
            Category = new CategoryRepository(db);
            Product  = new ProductRepository(db);
            Order    = new OrderRepository(db);
            User     = new UserRepository(db);

            this.db.Database.EnsureCreated();
        }
示例#2
0
 public OrderRepository(SportyContext db) : base(db)
 {
     this.db = db;
 }
示例#3
0
 public ProductRepository(SportyContext db) : base(db)
 {
     this.db = db;
 }
示例#4
0
 public ProductV1Controller(SportyContext context)
 {
     this.context = context;
     this.context.Database.EnsureCreated();
 }
示例#5
0
 public Repository(SportyContext db)
 {
     this.db    = db;
     this.dbSet = this.db.Set <T>();
 }
示例#6
0
 public CategoryRepository(SportyContext db) : base(db)
 {
     this.db = db;
 }