Renamed InsertActionProcedure, UpdateActionProcedure, and DeleteActionProcedure to their respective *ActionCommand counterparts to align with CQRS conventions. Updated all controller actions, handlers, tests, and related usages accordingly. No changes to business logic or method signatures.
36 lines
986 B
C#
36 lines
986 B
C#
using MediatR;
|
|
using ReC.Application.Common.Procedures.DeleteProcedure;
|
|
|
|
namespace ReC.Application.RecActions.Commands;
|
|
|
|
public record DeleteActionCommand : 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 RESULT data exists
|
|
/// </summary>
|
|
public bool Force { get; set; }
|
|
}
|
|
|
|
public class DeleteActionProcedureHandler(ISender sender) : IRequestHandler<DeleteActionCommand, int>
|
|
{
|
|
public async Task<int> Handle(DeleteActionCommand request, CancellationToken cancel)
|
|
{
|
|
return await sender.Send(new DeleteObjectProcedure
|
|
{
|
|
Entity = "ACTION",
|
|
Start = request.Start,
|
|
End = request.End,
|
|
Force = request.Force
|
|
}, cancel);
|
|
}
|
|
} |