SqlSugarClientHelper
程序员文章站
2022-12-25 13:51:38
using SqlSugar; using System; using System.Collections.Generic; using System.Configuration; using System.Linq; using System.Web; namespace Web.Code.DA... ......
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, 字段信息读取, 如:该属性是不是主键,是不是标识列等等信息 }); } } }
上一篇: EF DataFirst修改数据类型
下一篇: [目录]C#学习笔记