public UserWithSqlRepository(CusDbContext dbc) { //在构造方法中注入DbContext this._dbContext = dbc; }
//DI,在构造方法中注入DbContext public UserRepository(CusDbContext dbc) { this.DbContext = dbc; }
public UserWithSqlRepository(CusDbContext dbc) { //在构造方法中注入DbContext this._dbContext = dbc; }
//DI,在构造方法中注入DbContext public UserRepository(CusDbContext dbc) { this.DbContext = dbc; }