.core3.1 webpi 返回

SqlSugar 老数据
1457
该叫什么 ?? 发布于2020/4/26
悬赏:5 飞吻

如何将

 public static SqlSugarClient GetInstance()

        {

            return new SqlSugarClient(new ConnectionConfig()

            {

                DbType = SqlSugar.DbType.SqlServer,

                ConnectionString = Config.ConnectionString,

                InitKeyType = InitKeyType.Attribute,

                IsAutoCloseConnection = true,

                AopEvents = new AopEvents

                {

                    OnLogExecuting = (sql, p) =>

                    {

                        Console.WriteLine(sql);

                    }

                }

            });

        }

以依赖注入的方式实现,AddSingleton

热忱回答0