Refactor RecActionDto and add InvokeRecActionCommand

Converted RecActionDto from class to record for immutability
and value-based equality. Added nullable properties
`ActionId` and `ProfileId` to RecActionDto.

Introduced InvokeRecActionCommand.cs, which includes:
- A new InvokeRecActionCommand record inheriting from RecActionDto.
- Constructors for initializing InvokeRecActionCommand.
- An extension method `ToInvokeCommand` for converting
  RecActionDto to InvokeRecActionCommand.
This commit is contained in:
tekh 2025-11-27 11:20:41 +01:00
parent 0ec913b95e
commit d1e8f619f5
2 changed files with 21 additions and 1 deletions

View File

@ -1,6 +1,6 @@
namespace ReC.Application.Common.Dto;
public class RecActionDto
public record RecActionDto
{
public long? ActionId { get; init; }

View File

@ -0,0 +1,20 @@
using ReC.Application.Common.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ReC.Application.RecActions.Commands;
public record InvokeRecActionCommand : RecActionDto
{
public InvokeRecActionCommand(RecActionDto root) : base(root) { }
public InvokeRecActionCommand() { }
}
public static class InvokeRecActionCommandExtensions
{
public static InvokeRecActionCommand ToInvokeCommand(this RecActionDto dto) => new(dto);
}