Class ProfileController
The ProfileController class provides Business Layer methods for profiles and for profile property Definitions.
Inheritance
Namespace: DotNetNuke.Entities.Profile
Assembly: DotNetNuke.dll
Syntax
public class ProfileController : object
Methods
| Improve this Doc View SourceAddDefaultDefinitions(Int32)
Adds the default property definitions for a portal.
Declaration
public static void AddDefaultDefinitions(int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | Id of the Portal. |
AddPropertyDefinition(ProfilePropertyDefinition)
Adds a Property Defintion to the Data Store.
Declaration
public static int AddPropertyDefinition(ProfilePropertyDefinition definition)
Parameters
Type | Name | Description |
---|---|---|
ProfilePropertyDefinition | definition | An ProfilePropertyDefinition object. |
Returns
Type | Description |
---|---|
System.Int32 | The Id of the definition (or if negative the errorcode of the error). |
ClearAllUsersInfoProfileCacheByPortal(Int32)
Clear profiles of all users by portal Id.
Declaration
public static void ClearAllUsersInfoProfileCacheByPortal(int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId |
ClearProfileDefinitionCache(Int32)
Clears the Profile Definitions Cache.
Declaration
public static void ClearProfileDefinitionCache(int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | Id of the Portal. |
DeletePropertyDefinition(ProfilePropertyDefinition)
Deletes a Property Defintion from the Data Store.
Declaration
public static void DeletePropertyDefinition(ProfilePropertyDefinition definition)
Parameters
Type | Name | Description |
---|---|---|
ProfilePropertyDefinition | definition | The ProfilePropertyDefinition object to delete. |
GetPropertyDefinition(Int32, Int32)
Gets a Property Defintion from the Data Store by id.
Declaration
public static ProfilePropertyDefinition GetPropertyDefinition(int definitionId, int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | definitionId | The id of the ProfilePropertyDefinition object to retrieve. |
System.Int32 | portalId | Portal Id. |
Returns
Type | Description |
---|---|
ProfilePropertyDefinition | The ProfilePropertyDefinition object. |
GetPropertyDefinition(Int32)
The ProfileController class provides Business Layer methods for profiles and for profile property Definitions.
Declaration
public static ProfilePropertyDefinition GetPropertyDefinition(int definitionId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | definitionId |
Returns
Type | Description |
---|---|
ProfilePropertyDefinition |
GetPropertyDefinitionByName(Int32, String)
Gets a Property Defintion from the Data Store by name.
Declaration
public static ProfilePropertyDefinition GetPropertyDefinitionByName(int portalId, string name)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The id of the Portal. |
System.String | name | The name of the ProfilePropertyDefinition object to retrieve. |
Returns
Type | Description |
---|---|
ProfilePropertyDefinition | The ProfilePropertyDefinition object. |
GetPropertyDefinitionsByCategory(Int32, String)
Gets a collection of Property Defintions from the Data Store by category.
Declaration
public static ProfilePropertyDefinitionCollection GetPropertyDefinitionsByCategory(int portalId, string category)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The id of the Portal. |
System.String | category | The category of the Property Defintions to retrieve. |
Returns
Type | Description |
---|---|
ProfilePropertyDefinitionCollection | A ProfilePropertyDefinitionCollection object. |
GetPropertyDefinitionsByPortal(Int32, Boolean, Boolean)
Gets a collection of Property Defintions from the Data Store by portal.
Declaration
public static ProfilePropertyDefinitionCollection GetPropertyDefinitionsByPortal(int portalId, bool clone, bool includeDeleted)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The id of the Portal. |
System.Boolean | clone | Whether to use a clone object. |
System.Boolean | includeDeleted | Whether to include deleted profile properties. |
Returns
Type | Description |
---|---|
ProfilePropertyDefinitionCollection | A ProfilePropertyDefinitionCollection object. |
GetPropertyDefinitionsByPortal(Int32, Boolean)
Gets a collection of Property Defintions from the Data Store by portal.
Declaration
public static ProfilePropertyDefinitionCollection GetPropertyDefinitionsByPortal(int portalId, bool clone)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The id of the Portal. |
System.Boolean | clone | Whether to use a clone object. |
Returns
Type | Description |
---|---|
ProfilePropertyDefinitionCollection | A ProfilePropertyDefinitionCollection object. |
GetPropertyDefinitionsByPortal(Int32)
Gets a collection of Property Defintions from the Data Store by portal.
Declaration
public static ProfilePropertyDefinitionCollection GetPropertyDefinitionsByPortal(int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The id of the Portal. |
Returns
Type | Description |
---|---|
ProfilePropertyDefinitionCollection | A ProfilePropertyDefinitionCollection object. |
GetUserProfile(ref UserInfo)
Gets the Profile Information for the User.
Declaration
public static void GetUserProfile(ref UserInfo user)
Parameters
Type | Name | Description |
---|---|---|
UserInfo | user | The user whose Profile information we are retrieving. |
SearchProfilePropertyValues(Int32, String, String)
Searches the profile property values for a string (doesn't need to be the beginning).
Declaration
public static List<string> SearchProfilePropertyValues(int portalId, string propertyName, string searchString)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The portal identifier. |
System.String | propertyName | Name of the property. |
System.String | searchString | The search string. |
Returns
Type | Description |
---|---|
List<System.String> | List of matching values. |
UpdatePropertyDefinition(ProfilePropertyDefinition)
Updates a Property Defintion in the Data Store.
Declaration
public static void UpdatePropertyDefinition(ProfilePropertyDefinition definition)
Parameters
Type | Name | Description |
---|---|---|
ProfilePropertyDefinition | definition | The ProfilePropertyDefinition object to update. |
UpdateUserProfile(UserInfo, ProfilePropertyDefinitionCollection)
Updates a User's Profile.
Declaration
public static UserInfo UpdateUserProfile(UserInfo user, ProfilePropertyDefinitionCollection profileProperties)
Parameters
Type | Name | Description |
---|---|---|
UserInfo | user | The use to update. |
ProfilePropertyDefinitionCollection | profileProperties | The collection of profile properties. |
Returns
Type | Description |
---|---|
UserInfo | The updated User. |
UpdateUserProfile(UserInfo)
Updates a User's Profile.
Declaration
public static void UpdateUserProfile(UserInfo user)
Parameters
Type | Name | Description |
---|---|---|
UserInfo | user | The use to update. |
ValidateProfile(Int32, UserProfile)
Validates the Profile properties for the User (determines if all required properties have been set).
Declaration
public static bool ValidateProfile(int portalId, UserProfile objProfile)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The Id of the portal. |
UserProfile | objProfile | The profile. |
Returns
Type | Description |
---|---|
System.Boolean | true if the profile is valid, otherwise false. |