Files
ReC/src/ReC.Application/Endpoints/Commands/InsertEndpointCommand.cs
TekH 6681e56afc Refactor entity selection to use EntityType enum
Replaced string-based entity identifiers in CRUD procedure and command classes with a strongly-typed EntityType enum. Updated all relevant handlers and records to use the new enum property, improving type safety and maintainability. Added necessary using directives and updated documentation comments to reflect these changes.
2026-04-16 17:14:29 +02:00

24 lines
717 B
C#

using MediatR;
using ReC.Application.Common.Procedures.InsertProcedure;
using ReC.Application.Common.Procedures;
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 = EntityType.Endpoint,
Endpoint = request
}, cancel);
}
}