Files
ReC/src/ReC.Application/Results/Commands/InsertResultCommand.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

32 lines
1.0 KiB
C#

using MediatR;
using ReC.Application.Common.Procedures.InsertProcedure;
using ReC.Application.RecActions.Commands;
using ReC.Domain.Constants;
using ReC.Application.Common.Procedures;
namespace ReC.Application.Results.Commands;
public record InsertResultCommand : IInsertProcedure
{
public long? ActionId { get; set; }
public required RecStatus Status { get; set; }
public string? Header { get; set; }
public string? Body { get; set; }
public short Info { get; set; }
public string? InfoDetail { get; set; }
public string? Error { get; set; }
public required ResultType Type { get; set; }
public required InvokeReferences References { get; set; }
}
public class InsertResultProcedureHandler(ISender sender) : IRequestHandler<InsertResultCommand, long>
{
public async Task<long> Handle(InsertResultCommand request, CancellationToken cancel)
{
return await sender.Send(new InsertObjectProcedure
{
Entity = EntityType.Result,
Result = request
}, cancel);
}
}