using System; using System.Collections.Generic; using System.Linq.Expressions; using Umbraco.Core.Models.Membership; using Umbraco.Core.Persistence.Querying; namespace Umbraco.Core.Persistence.Repositories { public interface IUserRepository : IReadWriteQueryRepository { /// /// Gets the count of items based on a complex query /// /// /// int GetCountByQuery(IQuery query); /// /// Checks if a user with the username exists /// /// /// bool Exists(string username); /// /// Gets a list of objects associated with a given group /// /// Id of group IEnumerable GetAllInGroup(int groupId); /// /// Gets a list of objects not associated with a given group /// /// Id of group IEnumerable GetAllNotInGroup(int groupId); /// /// Gets paged user results /// /// /// /// /// /// /// /// /// A filter to only include user that belong to these user groups /// /// /// A filter to only include users that do not belong to these user groups /// /// Optional parameter to filter by specified user state /// /// IEnumerable GetPagedResultsByQuery(IQuery query, long pageIndex, int pageSize, out long totalRecords, Expression> orderBy, Direction orderDirection = Direction.Ascending, string[] includeUserGroups = null, string[] excludeUserGroups = null, UserState[] userState = null, IQuery filter = null); /// /// Returns a user by username /// /// /// /// This is only used for a shim in order to upgrade to 7.7 /// /// /// A non cached instance /// IUser GetByUsername(string username, bool includeSecurityData); /// /// Returns a user by id /// /// /// /// This is only used for a shim in order to upgrade to 7.7 /// /// /// A non cached instance /// IUser Get(int id, bool includeSecurityData); IProfile GetProfile(string username); IProfile GetProfile(int id); IDictionary GetUserStates(); Guid CreateLoginSession(int userId, string requestingIpAddress, bool cleanStaleSessions = true); bool ValidateLoginSession(int userId, Guid sessionId); int ClearLoginSessions(int userId); int ClearLoginSessions(TimeSpan timespan); void ClearLoginSession(Guid sessionId); } }