mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Update demo
This commit is contained in:
parent
36405e5270
commit
4194de5d64
@ -2,6 +2,7 @@
|
|||||||
using Microsoft.IdentityModel.Tokens;
|
using Microsoft.IdentityModel.Tokens;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using SqlSugar.DbConvert;
|
using SqlSugar.DbConvert;
|
||||||
|
using SqlSugar.Xugu;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
@ -22,22 +23,29 @@ namespace XuguTest
|
|||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//注册DLL写在程序启动时
|
||||||
|
InstanceFactory.CustomAssemblies = new System.Reflection.Assembly[] {
|
||||||
|
typeof(XuguProvider).Assembly
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||||
{
|
{
|
||||||
ConnectionString = "IP=218.123.127.33;DB=HOUSE;User=SYSDBA;PWD=SYSDBA;Port=5138;AUTO_COMMIT=on;CHAR_SET=UTF8",//CHAR_SET=GBK
|
ConnectionString = "IP=118.123.17.3;DB=HOUSE;User=SYSDBA;PWD=SYSDBA;Port=5138;AUTO_COMMIT=on;CHAR_SET=UTF8",//CHAR_SET=GBK
|
||||||
DbType = SqlSugar.DbType.Xugu,
|
DbType = SqlSugar.DbType.Xugu,
|
||||||
IsAutoCloseConnection = true,
|
IsAutoCloseConnection = true,
|
||||||
//ConfigureExternalServices = new ConfigureExternalServices() { SqlFuncServices = SqlFuncCustom.Methods }
|
//ConfigureExternalServices = new ConfigureExternalServices() { SqlFuncServices = SqlFuncCustom.Methods }
|
||||||
},
|
},
|
||||||
db => {
|
db => {
|
||||||
db.Aop.OnLogExecuting = (sql, pars) =>
|
db.Aop.OnLogExecuting = (sql, pars) =>
|
||||||
{
|
{
|
||||||
|
|
||||||
Console.WriteLine(UtilMethods.GetNativeSql(sql,pars));
|
Console.WriteLine(SqlSugar.UtilMethods.GetNativeSql(sql, pars));
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
db.CodeFirst.InitTables<MY_USER>();
|
db.CodeFirst.InitTables<MY_USER>();
|
||||||
|
|
||||||
db.DbMaintenance.TruncateTable<MY_USER>();
|
db.DbMaintenance.TruncateTable<MY_USER>();
|
||||||
|
Loading…
Reference in New Issue
Block a user