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.
26 lines
853 B
C#
26 lines
853 B
C#
using MediatR;
|
|
using ReC.Application.Common.Procedures.UpdateProcedure;
|
|
using ReC.Application.Common.Procedures.UpdateProcedure.Dto;
|
|
using ReC.Application.Common.Procedures;
|
|
|
|
namespace ReC.Application.EndpointParams.Commands;
|
|
|
|
public record UpdateEndpointParamsCommand : IUpdateProcedure<UpdateEndpointParamsDto>
|
|
{
|
|
public long Id { get; set; }
|
|
|
|
public UpdateEndpointParamsDto Data { get; set; } = null!;
|
|
}
|
|
|
|
public class UpdateEndpointParamsProcedureHandler(ISender sender) : IRequestHandler<UpdateEndpointParamsCommand, int>
|
|
{
|
|
public async Task<int> Handle(UpdateEndpointParamsCommand request, CancellationToken cancel)
|
|
{
|
|
return await sender.Send(new UpdateObjectProcedure
|
|
{
|
|
Entity = EntityType.EndpointParams,
|
|
Id = request.Id,
|
|
EndpointParams = request.Data
|
|
}, cancel);
|
|
}
|
|
} |