private bool ConfirmAccount(String confirmationToken) { using (var context = new JustCreativePublishingsContext()) { var user = context.Users.SingleOrDefault(u => u.ConfirmationToken == confirmationToken); if (user != null) { user.IsConfirmed = true; var dbSet = context.Set<User>(); dbSet.Attach(user); context.Entry(user).State = EntityState.Modified; context.SaveChanges(); return true; } } return false; }