Update Demo

This commit is contained in:
sunkaixuan 2019-05-06 14:55:44 +08:00
parent d39694bd19
commit bf20bc3e37

View File

@ -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 ####");
} }