mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-24 16:18:47 +08:00
Update Demo
This commit is contained in:
parent
d39694bd19
commit
bf20bc3e37
@ -22,6 +22,26 @@ namespace OrmTest
|
|||||||
|
|
||||||
private static void SqlSugarClient()
|
private static void SqlSugarClient()
|
||||||
{
|
{
|
||||||
|
//Create db
|
||||||
|
Console.WriteLine("#### SqlSugarClient Start ####");
|
||||||
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
|
||||||
|
{
|
||||||
|
DbType = DbType.SqlServer,
|
||||||
|
ConnectionString = Config.ConnectionString,
|
||||||
|
InitKeyType = InitKeyType.Attribute,
|
||||||
|
IsAutoCloseConnection = true,
|
||||||
|
AopEvents = new AopEvents
|
||||||
|
{
|
||||||
|
OnLogExecuting = (sql, p) =>
|
||||||
|
{
|
||||||
|
Console.WriteLine(sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//Use db
|
||||||
|
var dt = db.Ado.GetDataTable("select 1");
|
||||||
|
Console.WriteLine("#### SqlSugarClient End ####");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user