/// <summary>
 /// Removes a user from the membership data source.
 /// </summary>
 /// <param name="username">The name of the user to delete.</param>
 /// <param name="deleteAllRelatedData">true to delete data related to the user from the database; false to leave data related to the user in the database.</param>
 /// <returns>
 /// true if the user was successfully deleted; otherwise, false.
 /// </returns>
 public override bool DeleteUser(string username, bool deleteAllRelatedData)
 {
     try
     {
         User user = new User(username);
         user.delete();
     }
     catch (Exception)
     {
         return false;
     }
     return true;
 }
示例#2
0
 public void User_Delete_Admin_Not_Allowed() 
 {
     User u = new User(0);
     u.delete();
 }