Ejemplo n.º 1
0
        // can only log in now because it remembers one of the auto generated passwords.... remove users associated with my e-mail address.

        public static void RemoveMeFromMRDB()
        {
            var dataBase = IlluminateDatabase.Create(new DocumentStore { ConnectionStringName = "RavenServer" });
            var accountRepo = new RavenUserAccountRepository(dataBase.MasterStore);
            var userAccountService = new UserAccountService(accountRepo)
            {
                Configuration = MembershipRebootConfig.Create()
            };
            //var userAccountService = MvcApplication.UserAccountService;// this is null
            var account = userAccountService.GetByEmail("*****@*****.**");
            //userAccountService.userRepository.Remove(account); - inaccessible due to protetcion level
            userAccountService.Configuration.SecuritySettings.AllowAccountDeletion = true;
            //account.IsAccountVerified = false; - this is protected, but don't need it as conditional is or 
            userAccountService.DeleteAccount(account.Id);

        }