private static void Free(int eachCount) { GC.Collect(); //回收资源 System.Threading.Thread.Sleep(1); //休息1秒 PerHelper.Execute(eachCount, "Free like ", () => { IFreeSql fsql = new FreeSql.FreeSqlBuilder() .UseConnectionString(FreeSql.DataType.SqlServer, Config.connectionString) .UseAutoSyncStructure(false) //自动同步实体结构到数据库 .Build(); var list2 = fsql.Queryable <Test>().Where(it => it.F_String.Contains("abc")).ToList(); }); }
private static void Free(int eachCount) { GC.Collect(); //回收资源 System.Threading.Thread.Sleep(1); //休息1秒 IFreeSql fsql = new FreeSql.FreeSqlBuilder() .UseConnectionString(FreeSql.DataType.SqlServer, Config.connectionString) .UseAutoSyncStructure(false) //自动同步实体结构到数据库 .Build(); PerHelper.Execute(eachCount, "free", () => { var list2 = fsql.Queryable <Group>().IncludeMany(it => it.AUsers).Take(20).ToList(); //用.First(it=>it.Id==1)报错 }); }