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.
36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
using MediatR;
|
|
using ReC.Application.Common.Procedures.DeleteProcedure;
|
|
|
|
namespace ReC.Application.EndpointParams.Commands;
|
|
|
|
public record DeleteEndpointParamsCommand : IDeleteProcedure
|
|
{
|
|
/// <summary>
|
|
/// Start GUID/ID (inclusive)
|
|
/// </summary>
|
|
public long Start { get; set; }
|
|
|
|
/// <summary>
|
|
/// End GUID/ID (inclusive). If 0, will be set to Start value.
|
|
/// </summary>
|
|
public long End { get; set; }
|
|
|
|
/// <summary>
|
|
/// If true, delete even if dependent ACTION data exists
|
|
/// </summary>
|
|
public bool Force { get; set; }
|
|
}
|
|
|
|
public class DeleteEndpointParamsProcedureHandler(ISender sender) : IRequestHandler<DeleteEndpointParamsCommand, int>
|
|
{
|
|
public async Task<int> Handle(DeleteEndpointParamsCommand request, CancellationToken cancel)
|
|
{
|
|
return await sender.Send(new DeleteObjectProcedure
|
|
{
|
|
Entity = "ENDPOINT_PARAMS",
|
|
Start = request.Start,
|
|
End = request.End,
|
|
Force = request.Force
|
|
}, cancel);
|
|
}
|
|
} |