Ejemplo n.º 1
0
        static void Test7()
        {
#if __CORE__
            XTrace.WriteLine(RuntimeInformation.OSDescription);
#endif

            //DAL.AddConnStr("membership", "Server=10.0.0.3;Port=3306;Database=Membership;Uid=root;Pwd=Pass@word;", null, "mysql");

            Role.Meta.Session.Dal.Db.ShowSQL = true;
            Role.Meta.Session.Dal.Expire     = 10;
            //Role.Meta.Session.Dal.Db.Readonly = true;

            var list = Role.FindAll();
            Console.WriteLine(list.Count);

            list = Role.FindAll(Role._.Name.NotContains("abc"));
            Console.WriteLine(list.Count);

            Thread.Sleep(1000);

            list = Role.FindAll();
            Console.WriteLine(list.Count);

            Thread.Sleep(1000);

            var r = list.Last();
            r.IsSystem = !r.IsSystem;
            r.Update();

            Thread.Sleep(5000);

            list = Role.FindAll();
            Console.WriteLine(list.Count);
        }
Ejemplo n.º 2
0
        static void Test7()
        {
            Role.Meta.Session.Dal.Db.ShowSQL = true;
            Role.Meta.Session.Dal.Expire     = 10;
            //Role.Meta.Session.Dal.Db.Readonly = true;

            var list = Role.FindAll();

            Console.WriteLine(list.Count);

            list = Role.FindAll(Role._.Name.NotContains("abc"));
            Console.WriteLine(list.Count);

            Thread.Sleep(1000);

            list = Role.FindAll();
            Console.WriteLine(list.Count);

            Thread.Sleep(1000);

            var r = list.Last();

            r.IsSystem = !r.IsSystem;
            r.Update();

            Thread.Sleep(5000);

            list = Role.FindAll();
            Console.WriteLine(list.Count);
        }
Ejemplo n.º 3
0
        private static void Test7()
        {
            var config = new HttpConfigProvider
            {
                Server = "http://star.newlifex.com:6600",
                AppId  = "Test",
                Period = 5,
            };

            //config.LoadAll();
            DAL.SetConfig(config);
            //DAL.GetConfig = config.GetConfig;

            XCode.Setting.Current.Migration = Migration.Full;
            //Role.Meta.Session.Dal.Db.Migration = Migration.Full;
            //DAL.AddConnStr("membership", "Server=10.0.0.3;Port=3306;Database=Membership;Uid=root;Pwd=Pass@word;", null, "mysql");

            var dal = Role.Meta.Session.Dal;

            XTrace.WriteLine("dal={0}", dal.DbType);
            XTrace.WriteLine("db={0}", dal.Db.ServerVersion);

            Role.Meta.Session.Dal.Db.ShowSQL = true;
            Role.Meta.Session.Dal.Expire     = 10;
            //Role.Meta.Session.Dal.Db.Readonly = true;

            var list = Role.FindAll();

            Console.WriteLine(list.Count);

            list = Role.FindAll(Role._.Name.NotContains("abc"));
            Console.WriteLine(list.Count);

            Thread.Sleep(1000);

            list = Role.FindAll();
            Console.WriteLine(list.Count);

            Thread.Sleep(1000);

            var r = list.Last();

            r.IsSystem = !r.IsSystem;
            r.Update();

            Thread.Sleep(5000);

            list = Role.FindAll();
            Console.WriteLine(list.Count);
        }