public SqlContosoRepository(DbContextOptionsBuilder <ContosoContext>
                             dbOptionsBuilder)
 {
     _dbOptions = dbOptionsBuilder.Options;
     using (var db = new ContosoContext(_dbOptions))
     {
         db.Database.EnsureCreated();
     }
 }
示例#2
0
 public SqlProductRepository(ContosoContext db)
 {
     _db = db;
 }
 public SqlCustomerRepository(ContosoContext db)
 {
     _db = db;
 }
示例#4
0
 public SqlOrderRepository(ContosoContext db) => _db = db;