using CH.CQRS.Service.User; using CH.CQRS.Service.User.Options; using CH.Dal; using FluentValidation; using OpenHarbor.CQRS.Abstractions; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CH.CQRS.Command.User; public class UpdateNameCommand { public string? FirstName { get; set; } public string? LastName { get; set; } } public class UpdateNameCommandHandler(UserService userService) : ICommandHandler { public Task HandleAsync(UpdateNameCommand command, CancellationToken cancellationToken = default) { return userService.UpdateNameAsync(new UpdateNameCommandOptions { FirstName = command.FirstName, LastName = command.LastName, }, cancellationToken); } } public class UpdateNameCommandValidator : AbstractValidator { public UpdateNameCommandValidator() { } }