Refactor ErrorAction to use enum for type safety

Changed RecActionDto.ErrorAction from string to ErrorAction enum, updating all related logic to use enum values instead of strings. Added necessary using directives. This improves type safety, reduces risk of typos, and enhances maintainability.
This commit is contained in:
2025-12-12 13:04:23 +01:00
parent f9a73fbe0c
commit c422de445d
2 changed files with 8 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
using MediatR;
using ReC.Application.RecActions.Queries;
using ReC.Domain.Constants;
namespace ReC.Application.RecActions.Commands;
@@ -21,9 +22,9 @@ public class InvokeRecActionsCommandHandler(ISender sender) : IRequestHandler<In
{
var ok = await sender.Send(action.ToInvokeCommand(), cancel);
if (!ok)
switch (action.ErrorAction?.ToLowerInvariant())
switch (action.ErrorAction)
{
case "continue":
case ErrorAction.Continue:
break;
default:
return;