UserService Class


Service layer for User and Role objects.

public static class UserService
System.Object → UserService


Anonymous Gets the Anonymous user.
AnonymousId The Id of the Anonymous user (-1).
SystemId The Id of the System user (-2).


ChangePassword(int, string, string) Updates the password for the User.
GeneratePassword(int, bool, bool, bool, bool) Generates a random password.
Get(int, bool) Gets a User object from the repository.
Get(string, bool) Gets the User with the specified username.
Get(string, string, bool) Gets the User with the specified username/email and password.
GetByEmail(string, bool) Gets the User with the specified email address.
GetByGuid(Guid, bool) Gets the User with the specified guid.
GetByToken(string, bool, bool) Gets the User with the specified token.
GetFollowers(IEntity, QueryOptions) Get users that follow the specified entity.
GetFollowing(User, Query) Get users that the specified user is following.
GetLastSeen(int) Gets a System.DateTime object indicating when the specified User was last seen.
GetLikers(IEntity, QueryOptions) Get users that likes the specified entity.
GetMentioned(IEntity, QueryOptions) Gets users that is @mentioned in the specified entity.
GetPresence(int) Return the current presence of a user.
GetStarrers(IEntity, QueryOptions) Gets users that have starred the specified entity.
Insert(User, string, bool) Inserts a User into the repository.
MakeUniqueUsername(string) Helper method for making the specified username unique among users and spaces.
ResetPassword(int, string, string, bool) Resets a user's password.
Restore(int) Restores a trashed User, i.e. clears the IsTrashed flag.
Search(UserQuery) Performs a search according to the specified UserQuery object.
SetPassword(int, string) Set a new password for the specified user.
Trash(int) Trash a User, i.e. sets the IsTrashed flag.
Update(User, bool) Updates an existing User in the datasource.
ViewAsync(int, int?) Mark a user profile as viewed by the specified user.