经常出现Invalid operation. The connection is closed. 返回

求助
3 177

.net core

        public static string DB_ConnectionString { get; set; }

        public BaseContext()

        {

            Db = new SqlSugarClient(new ConnectionConfig()

            {

                ConnectionString = DB_ConnectionString,

                DbType = DbType.SqlServer,

                IsAutoCloseConnection = true,

                InitKeyType = InitKeyType.SystemTable,

                IsShardSameThread = true,

            });

        }

        public SqlSugarClient Db;





报错信息

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]()

   at System.Common.BaseRepository`1.GetListALL(Expression`1 whereExpression)

怎么解决,我看了之前的帖子好像都没解决掉

热忱回答3

版块

学习文档

最新会员

发布达人

回贴达人