添加项目文件。
This commit is contained in:
28
TelegramService.Entity/Db.cs
Normal file
28
TelegramService.Entity/Db.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user