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