mirror of
https://github.com/Megghy/MegghysAPI.git
synced 2025-12-06 22:26:56 +08:00
添加项目文件。
This commit is contained in:
19
DB.cs
Normal file
19
DB.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using FreeSql;
|
||||
using MegghysAPI.Attributes;
|
||||
|
||||
namespace MegghysAPI
|
||||
{
|
||||
public static class DB
|
||||
{
|
||||
public static IFreeSql SQL { get; private set; }
|
||||
[AutoInit(Order = 0)]
|
||||
internal static void InitDB()
|
||||
{
|
||||
SQL = new FreeSqlBuilder()
|
||||
.UseConnectionString(DataType.PostgreSQL, Config.Instance.DBConnectString)
|
||||
.UseAutoSyncStructure(true)
|
||||
.Build();
|
||||
SQL.UseJsonMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user