public void ChangePassword(Session session)
        {
            var curUser = session.User;

            curUser.Password          = curUser.Password;
            curUser.PasswordResetFlag = false;
            var watch = new Stopwatch();

            watch.Start();
            using (var db = new TestModel(_dbConn.GetConnection()))
            {
                db.Users.AddOrUpdate(curUser);
                db.SaveChanges();
            }
            Debug.WriteLine("ChangePassword: "******"ms");
        }
Example #2
0
        private void _addButton_OnClick(object sender, RoutedEventArgs e)
        {
            var watch = new Stopwatch();

            for (var i = 0; i < 100; i++)
            {
                watch.Start();
                var user = AddUser(i);
                using (var db = new TestModel(_dbConn.GetConnection()))
                {
                    db.Users.Add(user);
                    db.SaveChanges();
                }
            }
            _addSpeed.Text = "Add Speed: " + watch.ElapsedMilliseconds + "ms";
        }