Interface IUserRepository
- Namespace
- adas_core.Application.Repositories.Interfaces
- Assembly
- adas-core.Application.dll
public interface IUserRepository : IMongoRepository<User>
- Inherited Members
- Extension Methods
Methods
GetById(ObjectId)
Retrieves a user by their unique identifier asynchronously.
Task<User?> GetById(ObjectId id)
Parameters
idObjectIdThe unique identifier of the user to retrieve.
Returns
- Task<User>
A task that represents the asynchronous operation. The task result contains the User if found; otherwise, null.
GetByName(string)
Asynchronously retrieves a user by their name, returning null if no matching user is found.
Task<User?> GetByName(string name)
Parameters
namestringThe name of the user to look up.
Returns
- Task<User>
A task that represents the asynchronous operation. The task result contains the user with the specified name, or null if no matching user exists.
GetByUserAndAuthoritesName(string)
Asynchronously retrieves the user associated with the specified authorities name.
Task<User?> GetByUserAndAuthoritesName(string name)
Parameters
namestringThe authorities name used to look up the user.
Returns
- Task<User>
A task that represents the asynchronous operation. The task result contains the matching User if found; otherwise,
null.
GetByUserName(string)
Asynchronously retrieves a user matching the specified username. Returns null if no user is found.
Task<User?> GetByUserName(string name)
Parameters
namestringThe username to look up.
Returns
- Task<User>
A task that represents the asynchronous operation, containing the matching User or
nullif not found.
GetOrCreateSystemUser()
Retrieves the existing system user, creating a new one if it does not already exist.
Task<User> GetOrCreateSystemUser()
Returns
GetPaginatedUsers(PaginationFilter)
Retrieves a paginated, fluent queryable collection of User entities based on the supplied pagination filter.
IFindFluent<User, User> GetPaginatedUsers(PaginationFilter filter)
Parameters
filterPaginationFilterThe pagination filter that defines paging parameters such as page number and page size.
Returns
- IFindFluent<User, User>
An MongoDB.Driver.IFindFluent<TDocument, TProjection> representing the queryable, paginated user results.
GetUser(string, string)
Asynchronously retrieves a user by validating the provided username and password credentials. Returns the matching user when authentication succeeds, or null if no user matches the supplied credentials.
Task<User?> GetUser(string username, string password)
Parameters
usernamestringThe username used to look up the user account.
passwordstringThe password used to authenticate the user.
Returns
- Task<User>
A task that resolves to the authenticated User, or null if no user matches the provided credentials.
UpdateUser(User, bool)
Updates an existing user in the system, optionally updating the user's password when the updatePass flag is set.
Task<User?> UpdateUser(User user, bool updatePass)
Parameters
userUserThe user entity containing the updated information to be persisted.
updatePassboolA flag indicating whether the user's password should also be updated as part of this operation.