Files
ReC/src/ReC.Application/RecActions/Commands/DeleteActionCommand.cs
TekH cac33c46df Rename *ActionProcedure classes to *ActionCommand
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.
2026-03-24 11:39:55 +01:00

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);
}
}