• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Improve this Doc

Class ProfileController

The ProfileController class provides Business Layer methods for profiles and for profile property Definitions.

Inheritance
System.Object
ProfileController
Namespace: DotNetNuke.Entities.Profile
Assembly: DotNetNuke.dll
Syntax
public class ProfileController : object

Methods

| Improve this Doc View Source

AddDefaultDefinitions(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.

| Improve this Doc View Source

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).

| Improve this Doc View Source

ClearAllUsersInfoProfileCacheByPortal(Int32)

Clear profiles of all users by portal Id.

Declaration
public static void ClearAllUsersInfoProfileCacheByPortal(int portalId)
Parameters
Type Name Description
System.Int32 portalId
| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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
| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

UpdateUserProfile(UserInfo)

Updates a User's Profile.

Declaration
public static void UpdateUserProfile(UserInfo user)
Parameters
Type Name Description
UserInfo user

The use to update.

| Improve this Doc View Source

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.

Extension Methods

JsonExtensionsWeb.ToJson(Object)
  • View Source
Back to top by the community, for the community... #DNNCMS