View Source
Interface IUserRepository
Assembly: Umbraco.Core.dll
Syntax
public interface IUserRepository : IReadWriteQueryRepository<Guid, IUser>, IReadRepository<Guid, IUser>, IWriteRepository<IUser>, IQueryRepository<IUser>, IRepository
Methods
View Source
AddClientId(int, string)
Declaration
void AddClientId(int id, string clientId)
Parameters
| Type |
Name |
Description |
| int |
id |
|
| string |
clientId |
|
View Source
ClearLoginSession(Guid)
Declaration
void ClearLoginSession(Guid sessionId)
Parameters
| Type |
Name |
Description |
| Guid |
sessionId |
|
View Source
ClearLoginSessions(int)
Declaration
int ClearLoginSessions(int userId)
Parameters
| Type |
Name |
Description |
| int |
userId |
|
Returns
View Source
ClearLoginSessions(TimeSpan)
Declaration
int ClearLoginSessions(TimeSpan timespan)
Parameters
| Type |
Name |
Description |
| TimeSpan |
timespan |
|
Returns
View Source
CreateLoginSession(int?, string, bool)
Declaration
Guid CreateLoginSession(int? userId, string requestingIpAddress, bool cleanStaleSessions = true)
Parameters
| Type |
Name |
Description |
| int? |
userId |
|
| string |
requestingIpAddress |
|
| bool |
cleanStaleSessions |
|
Returns
View Source
ExistsByLogin(string)
Checks if a user with the login exists
Declaration
bool ExistsByLogin(string login)
Parameters
| Type |
Name |
Description |
| string |
login |
|
Returns
View Source
ExistsByUserName(string)
Checks if a user with the username exists
Declaration
bool ExistsByUserName(string username)
Parameters
| Type |
Name |
Description |
| string |
username |
|
Returns
View Source
Get(int)
Declaration
Parameters
| Type |
Name |
Description |
| int |
id |
|
Returns
View Source
Get(int?, bool)
Declaration
IUser? Get(int? id, bool includeSecurityData)
Parameters
| Type |
Name |
Description |
| int? |
id |
|
| bool |
includeSecurityData |
This is only used for a shim in order to upgrade to 7.7
|
Returns
| Type |
Description |
| IUser |
A non cached IUser instance
|
View Source
GetAllClientIds()
Declaration
IEnumerable<string> GetAllClientIds()
Returns
| Type |
Description |
| IEnumerable<string> |
|
View Source
GetAllInGroup(int)
Gets a list of IUser objects associated with a given group
Declaration
IEnumerable<IUser> GetAllInGroup(int groupId)
Parameters
| Type |
Name |
Description |
| int |
groupId |
Id of group
|
Returns
| Type |
Description |
| IEnumerable<IUser> |
|
View Source
GetAllNotInGroup(int)
Gets a list of IUser objects not associated with a given group
Declaration
IEnumerable<IUser> GetAllNotInGroup(int groupId)
Parameters
| Type |
Name |
Description |
| int |
groupId |
Id of group
|
Returns
| Type |
Description |
| IEnumerable<IUser> |
|
View Source
GetByClientId(string)
Declaration
IUser? GetByClientId(string clientId)
Parameters
| Type |
Name |
Description |
| string |
clientId |
|
Returns
View Source
GetByUsername(string, bool)
Returns a user by username
Declaration
IUser? GetByUsername(string username, bool includeSecurityData)
Parameters
| Type |
Name |
Description |
| string |
username |
|
| bool |
includeSecurityData |
This is only used for a shim in order to upgrade to 7.7
|
Returns
| Type |
Description |
| IUser |
A non cached IUser instance
|
View Source
GetClientIds(int)
Declaration
IEnumerable<string> GetClientIds(int id)
Parameters
| Type |
Name |
Description |
| int |
id |
|
Returns
| Type |
Description |
| IEnumerable<string> |
|
View Source
GetCountByQuery(IQuery<IUser>?)
Gets the count of items based on a complex query
Declaration
int GetCountByQuery(IQuery<IUser>? query)
Parameters
Returns
View Source
GetForUpgrade(int)
Gets a user for upgrade purposes, this will only return a result if the current runtime state is upgrade.
Declaration
IUser? GetForUpgrade(int id)
Parameters
| Type |
Name |
Description |
| int |
id |
The id to find the user by.
|
Returns
| Type |
Description |
| IUser |
An uncached IUser instance.
|
View Source
GetForUpgradeByEmail(string)
Gets a user by email for upgrade purposes, this will only return a result if the current runtime state is upgrade.
Declaration
IUser? GetForUpgradeByEmail(string email)
Parameters
| Type |
Name |
Description |
| string |
email |
The email to find the user by.
|
Returns
| Type |
Description |
| IUser |
An uncached IUser instance.
|
View Source
GetForUpgradeByUsername(string)
Gets a user by username for upgrade purposes, this will only return a result if the current runtime state is upgrade.
Declaration
IUser? GetForUpgradeByUsername(string username)
Parameters
| Type |
Name |
Description |
| string |
username |
The username to find the user by.
|
Returns
| Type |
Description |
| IUser |
An uncached IUser instance.
|
View Source
GetPagedResultsByQuery(IQuery<IUser>?, long, int, out long, Expression<Func<IUser, object?>>, Direction, string[]?, string[]?, UserState[]?, IQuery<IUser>?)
Declaration
IEnumerable<IUser> GetPagedResultsByQuery(IQuery<IUser>? query, long pageIndex, int pageSize, out long totalRecords, Expression<Func<IUser, object?>> orderBy, Direction orderDirection = Direction.Ascending, string[]? includeUserGroups = null, string[]? excludeUserGroups = null, UserState[]? userState = null, IQuery<IUser>? filter = null)
Parameters
| Type |
Name |
Description |
| IQuery<IUser> |
query |
|
| long |
pageIndex |
|
| int |
pageSize |
|
| long |
totalRecords |
|
| Expression<Func<IUser, object>> |
orderBy |
|
| Direction |
orderDirection |
|
| string[] |
includeUserGroups |
A filter to only include user that belong to these user groups
|
| string[] |
excludeUserGroups |
A filter to only include users that do not belong to these user groups
|
| UserState[] |
userState |
Optional parameter to filter by specified user state
|
| IQuery<IUser> |
filter |
|
Returns
| Type |
Description |
| IEnumerable<IUser> |
|
View Source
GetProfile(int)
Declaration
IProfile? GetProfile(int id)
Parameters
| Type |
Name |
Description |
| int |
id |
|
Returns
View Source
GetProfile(string)
Declaration
IProfile? GetProfile(string username)
Parameters
| Type |
Name |
Description |
| string |
username |
|
Returns
View Source
GetUserStates()
Declaration
IDictionary<UserState, int> GetUserStates()
Returns
View Source
InvalidateSessionsForRemovedProviders(IEnumerable<string>)
Invalidates sessions for users that aren't associated with the current collection of providers.
Declaration
void InvalidateSessionsForRemovedProviders(IEnumerable<string> currentLoginProviders)
Parameters
| Type |
Name |
Description |
| IEnumerable<string> |
currentLoginProviders |
The names of the currently configured providers.
|
View Source
RemoveClientId(int, string)
Declaration
bool RemoveClientId(int id, string clientId)
Parameters
| Type |
Name |
Description |
| int |
id |
|
| string |
clientId |
|
Returns
View Source
ValidateLoginSession(int, Guid)
Declaration
bool ValidateLoginSession(int userId, Guid sessionId)
Parameters
| Type |
Name |
Description |
| int |
userId |
|
| Guid |
sessionId |
|
Returns