mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 12:28:15 +08:00
v2.0.0-preview1105 #515
This commit is contained in:
@ -10,28 +10,6 @@ namespace FreeSql.Tests
|
||||
{
|
||||
public class UnitTest4
|
||||
{
|
||||
static Lazy<IFreeSql> sqliteLazy = new Lazy<IFreeSql>(() => new FreeSql.FreeSqlBuilder()
|
||||
.UseConnectionString(FreeSql.DataType.Sqlite, @"Data Source=|DataDirectory|\document.db;Attachs=xxxtb.db;")
|
||||
//.UseConnectionFactory(FreeSql.DataType.Sqlite, () =>
|
||||
//{
|
||||
// var conn = new System.Data.SQLite.SQLiteConnection(@"Data Source=|DataDirectory|\document.db;Pooling=true;");
|
||||
// //conn.Open();
|
||||
// //var cmd = conn.CreateCommand();
|
||||
// //cmd.CommandText = $"attach database [xxxtb.db] as [xxxtb];\r\n";
|
||||
// //cmd.ExecuteNonQuery();
|
||||
// //cmd.Dispose();
|
||||
// return conn;
|
||||
//})
|
||||
.UseAutoSyncStructure(true)
|
||||
//.UseGenerateCommandParameterWithLambda(true)
|
||||
.UseLazyLoading(true)
|
||||
.UseMonitorCommand(
|
||||
cmd => Trace.WriteLine("\r\n线程" + Thread.CurrentThread.ManagedThreadId + ": " + cmd.CommandText) //监听SQL命令对象,在执行前
|
||||
//, (cmd, traceLog) => Console.WriteLine(traceLog)
|
||||
)
|
||||
.Build());
|
||||
public static IFreeSql sqlite => sqliteLazy.Value;
|
||||
|
||||
|
||||
[Fact]
|
||||
public void TestHzyTuple()
|
||||
@ -47,11 +25,8 @@ namespace FreeSql.Tests
|
||||
.Where(w => w.t1.Code == "xxx" && w.t2.OptionsEntity03 == true)
|
||||
.GroupBy(w => new { w.t1 })
|
||||
.OrderBy(w => w.Key.t1.AddTime)
|
||||
.ToSql(w => new { w.Key.t1 });
|
||||
.ToSql(w => w.Key );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user