Beispiel #1
0
        public ActionResult DeleteUser(int id)
        {
            var userToDelete = _membershipProviderApplicationService.GetUserById(id, false, "ShopgunMembershipProvider");

            _membershipProviderApplicationService.DeleteUser(userToDelete.UserName, true);

            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        //Added to user.cs as ToMembershipUser()
        //private MembershipUser ConvertToMembershipUser(User u)
        //{
        //    if (u == null)
        //    {
        //        return null;
        //    }

        //    return new MembershipUser(ProviderName, u.UserName, u.Id, u.Email,
        //                              string.Empty, string.Empty, true, false, DateTime.Now, DateTime.Now,
        //                              DateTime.Now, DateTime.Now, DateTime.Now);
        //}

        /// <summary>
        /// Removes a user from the membership data source.
        /// </summary>
        /// <param name="username"></param>
        /// <param name="deleteAllRelatedData"></param>
        /// <returns></returns>
        public override bool DeleteUser(string username, bool deleteAllRelatedData)
        {
            return(_membershipProviderApplicationService.DeleteUser(username, deleteAllRelatedData));
        }