Class UpdateUserCommandHandler
Namespace: Identity.Application.Requests.Handlers.User
Assembly: Identity.Application.dll
UpdateUserCommandHandler handles UpdateUserCommand requests and updates a user.
Inheritance
object ← UpdateUserCommandHandler
Implements
IRequestHandler<UpdateUserCommand, Result<UserResponse\>\>
Inherited Members
object.Equals\(object?\), object.Equals\(object?, object?\), object.GetHashCode\(\), object.GetType\(\), object.ReferenceEquals\(object?, object?\), object.ToString\(\)
Constructors
UpdateUserCommandHandler\(IUserRepository, IUnitOfWork, IAuthorizationService, IHttpContextAccessor\)
Constructor takes dependencies for interacting with storage system and managing transactions.
Parameters
userRepository IUserRepository
Data access layer to user context.
unitOfWork IUnitOfWork
Unit of work that will sync changes on database through dbContext.
authorizationService IAuthorizationService
Service that will check the permissions to perform.
httpContextAccessor IHttpContextAccessor
Accessor that permit the handler to access the current HTTP context.
Methods
Handle\(UpdateUserCommand, CancellationToken\)
Handle method retrieves user, applies updates, and saves updated user to storage system.
Parameters
command UpdateUserCommand
Identity.Application.Requests.Handlers.User.UpdateUserCommand received from the client from body request.
cancellationToken CancellationToken
Token that propagate method cancellation if needed.
Returns
Task <Result< UserResponse \>\>
The updated Identity.Application.Requests.Handlers.User.