初始化项目
This commit is contained in:
29
Models/Test_Feac.cs
Normal file
29
Models/Test_Feac.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using SqlSugar;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace UI.Lib
|
||||
{
|
||||
public class Test_Feac
|
||||
{
|
||||
public static SqlSugarScope Db = new SqlSugarScope(new ConnectionConfig()
|
||||
{
|
||||
DbType = SqlSugar.DbType.MySql,
|
||||
ConnectionString = "Server=blv-cloud-db.mysql.rds.aliyuncs.com;Database=Face;Uid=blv_rcu;Pwd=fnadiaJDIJ7546;charset=utf8;port=3307;",
|
||||
IsAutoCloseConnection = true
|
||||
},
|
||||
db =>
|
||||
{
|
||||
//db.DbMaintenance.CreateDatabase(); //个别数据库不支持
|
||||
//Type[] types = Assembly
|
||||
//.LoadFrom($@"D:\BLV_SYNC\RD_WEB\SynologyDrive\欧阳磊\Faces\Face.Web\bin\Face.Domain.dll")//如果 .dll报错,可以换成 xxx.exe 有些生成的是exe
|
||||
//.GetTypes().Where(it => it.FullName.Contains("Face.Domain.Application.FaceAll."))//命名空间过滤,当然你也可以写其他条件过滤
|
||||
//.ToArray();//断点调试一下是不是需要的Type,不是需要的在进行过滤
|
||||
// db.CodeFirst.SetStringDefaultLength(200).InitTables(types);//根据types创建表
|
||||
//单例参数配置,所有上下文生效
|
||||
db.Aop.OnLogExecuting = (s, p) =>
|
||||
{
|
||||
Debug.WriteLine(s);
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user