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
835 B
C#
26 lines
835 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.EndpointAuth.Commands;
|
|
|
|
public record UpdateEndpointAuthCommand : IUpdateProcedure<UpdateEndpointAuthDto>
|
|
{
|
|
public long Id { get; set; }
|
|
|
|
public UpdateEndpointAuthDto Data { get; set; } = null!;
|
|
}
|
|
|
|
public class UpdateEndpointAuthProcedureHandler(ISender sender) : IRequestHandler<UpdateEndpointAuthCommand, int>
|
|
{
|
|
public async Task<int> Handle(UpdateEndpointAuthCommand request, CancellationToken cancel)
|
|
{
|
|
return await sender.Send(new UpdateObjectProcedure
|
|
{
|
|
Entity = EntityType.EndpointAuth,
|
|
Id = request.Id,
|
|
EndpointAuth = request.Data
|
|
}, cancel);
|
|
}
|
|
} |