Renamed Insert/Update/DeleteEndpointProcedure classes to their respective Command counterparts to follow CQRS conventions. Updated controller actions, handlers, InsertObjectProcedure, and related unit tests to use the new Command types. No functional changes were made; this is a naming refactor.
25 lines
750 B
C#
25 lines
750 B
C#
using MediatR;
|
|
using ReC.Application.Common.Procedures.UpdateProcedure;
|
|
using ReC.Application.Common.Procedures.UpdateProcedure.Dto;
|
|
|
|
namespace ReC.Application.Endpoints.Commands;
|
|
|
|
public record UpdateEndpointCommand : IUpdateProcedure<UpdateEndpointDto>
|
|
{
|
|
public long Id { get; set; }
|
|
|
|
public UpdateEndpointDto Data { get; set; } = null!;
|
|
}
|
|
|
|
public class UpdateEndpointProcedureHandler(ISender sender) : IRequestHandler<UpdateEndpointCommand, int>
|
|
{
|
|
public async Task<int> Handle(UpdateEndpointCommand request, CancellationToken cancel)
|
|
{
|
|
return await sender.Send(new UpdateObjectProcedure
|
|
{
|
|
Entity = "ENDPOINT",
|
|
Id = request.Id,
|
|
Endpoint = request.Data
|
|
}, cancel);
|
|
}
|
|
} |