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:
parent
0ec913b95e
commit
d1e8f619f5
@ -1,6 +1,6 @@
|
||||
namespace ReC.Application.Common.Dto;
|
||||
|
||||
public class RecActionDto
|
||||
public record RecActionDto
|
||||
{
|
||||
public long? ActionId { get; init; }
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user