时不时的报错the connection is closed,有什么办法解决吗? 返回

求助
2 153

fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]

      An unhandled exception has occurred while executing the request.

System.AggregateException: One or more errors occurred. (Invalid operation. The connection is closed.)

 ---> System.InvalidOperationException: Invalid operation. The connection is closed.

   at SqlSugar.AdoProvider.GetDataReaderAsync(String sql, SugarParameter[] parameters)

   at SqlSugar.QueryableProvider`1.GetDataAsync[TResult](KeyValuePair`2 sqlObj)

   at SqlSugar.QueryableProvider`1._ToListAsync[TResult]()

通过注入ISqlSugarClient使用,异步查询await _db.Queryable<TEntity>().WhereIF(whereExpression != null, whereExpression).ToListAsync();有时正常,有时就报the connection is closed,比较烦人,有没有办法解决呢?

热忱回答2

  • 没有 

    0 回复
  • @llhhll004:这个问题解决不了么,你之前回复的那个关闭自动释放改为手动也不行?话说手动怎么用

    0 回复

版块

学习文档

最新会员

发布达人

回贴达人