public void Test()
 {
     using (MysqlRepository mysqlRepository = new MysqlRepository())
     {
         using (SqlServerRepository sqlServerRepository = new SqlServerRepository())
         {
             try
             {
                 //开启mysql事务
                 var mysqlUnitWork = mysqlRepository.UnitOfWork.BeginTransaction(() =>
                 {
                     mysqlRepository.Insert(new Comment()
                     {
                         Content = "test"
                     });
                 });
                 //开始sqlserver事务
                 var sqlserverUnitWork = sqlServerRepository.UnitOfWork.BeginTransaction(() =>
                 {
                     //sqlServerRepository.Insert(new Lige.Model.Order()
                     //{
                     //	Remark = "test"
                     //});
                 });
                 //都完成后一起提交
                 mysqlUnitWork.Commit();
                 sqlserverUnitWork.Commit();
             }
             catch (System.Exception ex)
             {
             }
         }
     }
 }
        public void Test()
        {
            using (MysqlRepository mysqlRepository = new MysqlRepository())
            {
                var aaa = mysqlRepository.QuerySet <Comment>()
                          .Distinct()
                          .PageList(1, 1, x => new
                {
                    id = Function.Concat(Function.Concat(x.Content, "test"), x.ArticleId.ToString())
                });


                //mysqlRepository.UnitOfWork.BeginTransaction(() =>
                //{
                //	mysqlRepository.Insert(new Comment
                //	{
                //		Content = "test11111",
                //		ArticleId = 11,
                //		Type = 1,
                //		SubTime = DateTime.Now,
                //		PId = 0,
                //		RefCommentId = 0
                //	});

                //	MysqlRepository1 mysqlRepository1 = new MysqlRepository1();

                //	mysqlRepository1.Insert(new News
                //	{
                //		NewsLabel = "test",
                //		Headlines = "test",
                //		Content = "test",
                //		NewsFrom = "test",

                //	});
                //	//throw new System.Exception("test");
                //});

                //mysqlRepository.UnitOfWork.Commit();
            }
        }