IUserService¶
Namespace: Rest_API.Services.User
Service interface for user management operations including user retrieval, updates, and deletion.
Methods¶
ChangePassword(ApiUser, String, String)¶
Changes a user's password after validating the current password.
Parameters¶
user
ApiUser
The user whose password will be changed.
currentPassword
String
The user's current password for validation.
newPassword
String
The new password to set.
Returns¶
A task representing the asynchronous password change operation.
Exceptions¶
ArgumentException
Thrown when parameters are null or invalid.
UnauthorizedAccessException
Thrown when current password is incorrect.
ChangeUser(ApiUser)¶
Updates user information in the system.
Parameters¶
user
ApiUser
The user object with updated information.
Returns¶
A task representing the asynchronous user update operation.
Exceptions¶
ArgumentException
Thrown when user is null or contains invalid data.
InvalidOperationException
Thrown when user update fails.
DeleteUser(ApiUser)¶
Deletes a user from the system.
Parameters¶
user
ApiUser
The user to delete from the system.
Returns¶
A task containing true if deletion was successful, false otherwise.
Exceptions¶
ArgumentException
Thrown when user is null.
InvalidOperationException
Thrown when user deletion fails.
GetUserById(String)¶
Retrieves a specific user by their unique identifier.
Parameters¶
userId
String
The unique identifier of the user to retrieve.
Returns¶
A task containing the user if found, or null if not found.
Exceptions¶
ArgumentException
Thrown when userId is null or empty.
GetUserInformations()¶
Retrieves a list of all users in the system.
Returns¶
A task containing a list of all API users.
Exceptions¶
UnauthorizedAccessException
Thrown when user lacks sufficient permissions.