Пример #1
0
        public static void T_SimpleSelect()
        {
            //-----------------------------
            //prepare data
            T_SimpleInsert_Update();
            //-----------------------------

            var connStr = GetMySqlConnString();
            var conn    = new MySqlConnection(connStr);

            conn.Open();
            {
                var select = new SimpleSelect("test001");
                select.Connection = conn;

                //------------------------------
                //for anonyomous type
                foreach (var d in select.ExecRecordIter(
                             (r) => new { first_name = r.str(), last_name = r.str() }))
                {
                }
                //------------------------------

                foreach (var d in select.ExecRecordIter(() => new UserInfo()))
                {
                }
                foreach (var d in select.ExecRecordIter(() => new UserInfo2()))
                {
                }
            }

            conn.Close();
        }
Пример #2
0
        private void StartSelectCheckout()
        {
            const string selectDescription = "Select a branch to check out";

            using Repository repo = new Repository(Environment.CurrentDirectory);

            var availableBranches = repo.Branches.OrderBy(b => b.IsRemote).ToArray();

            if (availableBranches.Length < 1)
            {
                Log.Error("No branches found.");
                Environment.Exit(1);
            }

            string[] branchNames = availableBranches.Select(b => b.FriendlyName).ToArray();

            int selectedIndex = new SimpleSelect(selectDescription, branchNames).Show();

            if (selectedIndex < 0)
            {
                return;
            }

            if (availableBranches[selectedIndex].IsRemote)
            {
                CheckoutRemote(repo, availableBranches[selectedIndex]);
                return;
            }

            GitUtils.CheckOutBranch(repo, availableBranches[selectedIndex]);
            GitUtils.ShowLatestCommit(repo);
        }
Пример #3
0
        private void StartSelectReview(Branch[] options = null)
        {
            var selectDescription = "There were more than one results. Select a branch to review:";

            if (options == null)
            {
                selectDescription = "Select a branch to review";
                GitUtils.PerformFetch();
            }
            using Repository repo = new Repository(Environment.CurrentDirectory);

            var availableBranches = options ?? repo.Branches.Where(b => b.IsRemote).ToArray();

            if (availableBranches.Length < 1)
            {
                Log.Error("No remote branches found.");
                Environment.Exit(1);
            }

            string[] branchNames = availableBranches.Select(b => b.FriendlyName).ToArray();

            int selectedIndex = new SimpleSelect(selectDescription, branchNames).Show();

            if (selectedIndex < 0)
            {
                return;
            }

            GitUtils.CheckOutBranch(repo, availableBranches[selectedIndex]);
            GitUtils.ShowLatestCommit(repo);
        }
 public void UserLogin()
 {
     ulog = new UserLogin(driver);
     browserOps.Goto("https://uitesting.eb-test.site/");
     ulog.UserName.SendKeys("*****@*****.**");
     ulog.Password.SendKeys("Qwerty@123");
     ulog.LoginButton.Click();
     Console.WriteLine("Login Success");
     s = new SimpleSelect(driver);
     browserOps.UrlToBe("https://uitesting.eb-test.site/UserDashBoard");
 }
Пример #5
0
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.SetData("DataDirectory", Path.GetFullPath("..\\..\\App_Data"));

            using (SchoolContext ctx = new SchoolContext())
            {
                HowWeDid(ctx);

                HowWeDo(ctx);

                PropertiesMapperExample(ctx);

                ExpressionsCombinationExample.CombineSelectExpression(ctx);
                SimpleSelect.ShowStudents(ctx);
                SelectNonCache.ShowStudents(ctx);
                InitInheritanceExample.ShowCourses(ctx);
                MemberInitExample.ShowStudents(ctx);
                CultureResolveExample.ShowCourses(ctx);
                FilterExpression.FilterStudents(ctx);
                SelectUsingMapper.ShowStudents(ctx);
            }

            Console.ReadKey();
        }