示例#1
0
        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();
            });
        }
示例#2
0
        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)报错
            });
        }