Class ProfileRepository
Provides access to a user profile.
Inheritance
System.Object
ProfileRepository
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Shell.Profile
Assembly: EPiServer.Shell.dll
Version: 8.11.0Syntax
[ServiceConfiguration(typeof(IProfileRepository), Lifecycle = ServiceInstanceScope.Singleton)]
public class ProfileRepository : IProfileRepository
Constructors
ProfileRepository(DynamicDataStoreFactory, ISynchronizedObjectInstanceCache)
Creates a new instance of the ProfileRepository class.
Declaration
public ProfileRepository(DynamicDataStoreFactory storeFactory, ISynchronizedObjectInstanceCache cache)
Parameters
Type | Name | Description |
---|---|---|
DynamicDataStoreFactory | storeFactory | The store factory to use for creating stores. |
ISynchronizedObjectInstanceCache | cache |
Methods
Delete(String)
Deletes the profile associated with a user name.
Declaration
public void Delete(string userName)
Parameters
Type | Name | Description |
---|---|---|
System.String | userName | The user name of the profile to delete. |
GetOrCreateProfile(String)
Gets or creates a user profile.
Declaration
public ProfileData GetOrCreateProfile(string userName)
Parameters
Type | Name | Description |
---|---|---|
System.String | userName | The user name of the profile to get or create. |
Returns
Type | Description |
---|---|
ProfileData | An existing user profile, or a newly created profile if no profile previously existed. |
GetProfile(String)
Gets an existing user profile.
Declaration
public ProfileData GetProfile(string userName)
Parameters
Type | Name | Description |
---|---|---|
System.String | userName | The username of the profile to get. |
Returns
Type | Description |
---|---|
ProfileData | An existing profile or null if no profile exists. |
Save(ProfileData)
Saves the given profile to persistence medium.
Declaration
public void Save(ProfileData profile)
Parameters
Type | Name | Description |
---|---|---|
ProfileData | profile | The profile data to store. |
Events
ProfileCreated
Invoked when a profile is created for the first time.
Declaration
public event EventHandler<ProfileEventArgs> ProfileCreated
Event Type
Type | Description |
---|---|
System.EventHandler<ProfileEventArgs> |