예제 #1
0
        private bool ConfirmAccount(string confirmationToken)
        {
            MwaDBContext context = new MwaDBContext();
            MechWarrior  user    = context.Users.SingleOrDefault(u => u.ConfirmationToken == confirmationToken);

            if (user != null)
            {
                user.IsConfirmed = true;
                DbSet <MechWarrior> dbSet = context.Set <MechWarrior>();
                dbSet.Attach(user);
                context.Entry(user).State = EntityState.Modified;
                context.SaveChanges();

                return(true);
            }
            return(false);
        }