/// <summary> /// 针对数据库直接执行查询语句 /// </summary> public IQueryable <T> ExecuteSqlQuery <T>(string sql) where T : class { if (_dbContext != null) { return(_dbContext.Set <T>().FromSql(sql)); } return(null); }
public async void AddEntity(T entity) { await _dbContext.Set <T>().AddAsync(entity); }