Refactor endpoint Procedures to Commands for CQRS alignment
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.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using MediatR;
|
||||
using ReC.Application.Common.Procedures.InsertProcedure;
|
||||
|
||||
namespace ReC.Application.Endpoints.Commands;
|
||||
|
||||
public record InsertEndpointCommand : IInsertProcedure
|
||||
{
|
||||
public bool? Active { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public string? Uri { get; set; }
|
||||
}
|
||||
|
||||
public class InsertEndpointProcedureHandler(ISender sender) : IRequestHandler<InsertEndpointCommand, long>
|
||||
{
|
||||
public async Task<long> Handle(InsertEndpointCommand request, CancellationToken cancel)
|
||||
{
|
||||
return await sender.Send(new InsertObjectProcedure
|
||||
{
|
||||
Entity = "ENDPOINT",
|
||||
Endpoint = request
|
||||
}, cancel);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user