Renamed UpdateEndpointAuthProcedure to UpdateEndpointAuthCommand across the codebase for improved naming consistency. Updated controller, handler, and tests to use the new command name, aligning with CQRS conventions for state-modifying operations.
25 lines
786 B
C#
25 lines
786 B
C#
using MediatR;
|
|
using ReC.Application.Common.Procedures.UpdateProcedure;
|
|
using ReC.Application.Common.Procedures.UpdateProcedure.Dto;
|
|
|
|
namespace ReC.Application.EndpointAuth.Commands;
|
|
|
|
public record UpdateEndpointAuthCommand : IUpdateProcedure<UpdateEndpointAuthDto>
|
|
{
|
|
public long Id { get; set; }
|
|
|
|
public UpdateEndpointAuthDto Data { get; set; } = null!;
|
|
}
|
|
|
|
public class UpdateEndpointAuthProcedureHandler(ISender sender) : IRequestHandler<UpdateEndpointAuthCommand, int>
|
|
{
|
|
public async Task<int> Handle(UpdateEndpointAuthCommand request, CancellationToken cancel)
|
|
{
|
|
return await sender.Send(new UpdateObjectProcedure
|
|
{
|
|
Entity = "ENDPOINT_AUTH",
|
|
Id = request.Id,
|
|
EndpointAuth = request.Data
|
|
}, cancel);
|
|
}
|
|
} |