ProfileProvider.DeleteInactiveProfiles Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
When overridden in a derived class, deletes all user-profile data for profiles in which the last activity date occurred before the specified date.
public:
abstract int DeleteInactiveProfiles(System::Web::Profile::ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate);
public abstract int DeleteInactiveProfiles (System.Web.Profile.ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate);
abstract member DeleteInactiveProfiles : System.Web.Profile.ProfileAuthenticationOption * DateTime -> int
Public MustOverride Function DeleteInactiveProfiles (authenticationOption As ProfileAuthenticationOption, userInactiveSinceDate As DateTime) As Integer
Parameters
- authenticationOption
- ProfileAuthenticationOption
One of the ProfileAuthenticationOption values, specifying whether anonymous, authenticated, or both types of profiles are deleted.
- userInactiveSinceDate
- DateTime
A DateTime that identifies which user profiles are considered inactive. If the LastActivityDate value of a user profile occurs on or before this date and time, the profile is considered inactive.
Returns
The number of profiles deleted from the data source.
Examples
The following code example shows the method signature for an implementation of the DeleteInactiveProfiles method. For an example of a full ProfileProvider implementation, see How to: Build and Run the Profile Provider Example.
public override int DeleteInactiveProfiles(
ProfileAuthenticationOption authenticationOption,
DateTime userInactiveSinceDate)
{
return 0;
}
Public Overrides Function DeleteInactiveProfiles( _
ByVal authenticationOption As ProfileAuthenticationOption, _
ByVal userInactiveSinceDate As DateTime) As Integer
Return 0
End Function
Remarks
The DeleteInactiveProfiles method is used to remove unused profile data from the data source. Only data for the applicationName
specified in the configuration file is removed. The authenticationOption
parameter specifies whether only anonymous profiles, only authenticated profiles, or all profiles are searched. Profiles in which the LastActivityDate occurs on or before the specified userInactiveSinceDate
parameter value are deleted.