29 lines
718 B
C#
29 lines
718 B
C#
using SqlSugar;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace TelegramService.Entity
|
|
{
|
|
public class Db
|
|
{
|
|
|
|
/// <summary>
|
|
/// 数据库连接
|
|
/// </summary>
|
|
public static SqlSugarClient dbConnection
|
|
{
|
|
get
|
|
{
|
|
|
|
return new SqlSugarClient(new ConnectionConfig()
|
|
{
|
|
ConnectionString = Appsettings.Conf.ConnectionStrings.DBConnection,//连接符字串
|
|
DbType = SqlSugar.DbType.MySql, //数据库类型
|
|
IsAutoCloseConnection = true //不设成true要手动close
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|