Rename EndpointParams procedures to commands for CQRS clarity
Renamed Insert/Update/DeleteEndpointParamsProcedure classes and handlers to use the "Command" suffix (e.g., InsertEndpointParamsCommand) for consistency with CQRS conventions. Updated all controller actions, handlers, and tests to use the new command names. This improves clarity and aligns naming with standard command patterns.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using MediatR;
|
||||
using ReC.Application.Common.Procedures.UpdateProcedure;
|
||||
using ReC.Application.Common.Procedures.UpdateProcedure.Dto;
|
||||
|
||||
namespace ReC.Application.EndpointParams.Commands;
|
||||
|
||||
public record UpdateEndpointParamsCommand : IUpdateProcedure<UpdateEndpointParamsDto>
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
public UpdateEndpointParamsDto Data { get; set; } = null!;
|
||||
}
|
||||
|
||||
public class UpdateEndpointParamsProcedureHandler(ISender sender) : IRequestHandler<UpdateEndpointParamsCommand, int>
|
||||
{
|
||||
public async Task<int> Handle(UpdateEndpointParamsCommand request, CancellationToken cancel)
|
||||
{
|
||||
return await sender.Send(new UpdateObjectProcedure
|
||||
{
|
||||
Entity = "ENDPOINT_PARAMS",
|
||||
Id = request.Id,
|
||||
EndpointParams = request.Data
|
||||
}, cancel);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user