sunkaixuan
8 years ago
8 changed files with 69 additions and 66 deletions
@ -0,0 +1,15 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
|
|||
namespace OrmTest.Demo |
|||
{ |
|||
public class DbFirst |
|||
{ |
|||
public static void Init() |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
@ -0,0 +1,23 @@ |
|||
using SqlSugar; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
|
|||
namespace OrmTest.Demo |
|||
{ |
|||
public class DemoBase |
|||
{ |
|||
public static SqlSugarClient GetInstance() |
|||
{ |
|||
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true }); |
|||
db.Ado.IsEnableLogEvent = true; |
|||
db.Ado.LogEventStarting = (sql, pars) => |
|||
{ |
|||
Console.WriteLine(sql + "\r\n" + db.RewritableMethods.SerializeObject(pars)); |
|||
Console.WriteLine(); |
|||
}; |
|||
return db; |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue