SqlSugarClientHelper

匿名 (未验证) 提交于 2019-12-02 22:06:11
using SqlSugar; using System; using System.Collections.Generic; using System.Configuration; using System.Linq; using System.Web;  namespace Web.Code.DAL {     public static class SqlSugarClientHelper     {         public static string ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;          public static SqlSugarClient SqlDBConnection         {             get => new SqlSugarClient(new ConnectionConfig()              {                 ConnectionString = ConnectionString,//必填, 数据库连接字符串                 DbType = SqlSugar.DbType.SqlServer,         //必填, 数据库类型                 IsAutoCloseConnection = true,       //默认false, 不自动关闭数据库连接。设置为true无需使用using或者Close操作,自动释放。                 InitKeyType = InitKeyType.SystemTable    //默认SystemTable, 字段信息读取, 如:该属性是不是主键,是不是标识列等等信息              });         }     } }

文章来源: SqlSugarClientHelper
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!