Add InvokeRecActionCommandExtensions for ISender

Introduce a new static class `InvokeRecActionCommandExtensions`
to extend the `ISender` interface with the `InvokeRecAction`
method. This method simplifies the invocation of
`InvokeRecActionCommand` by allowing callers to pass only the
`profileId`, internally creating and sending the command.
This commit is contained in:
tekh 2025-11-25 17:10:44 +01:00
parent 2cf4d73cf3
commit 5697eb3dd8

View File

@ -5,4 +5,10 @@ namespace ReC.Application.RecActions.Commands;
public class InvokeRecActionCommand : IRequest
{
public int ProfileId { get; init; }
}
public static class InvokeRecActionCommandExtensions
{
public static Task InvokeRecAction(this ISender sender, int profileId)
=> sender.Send(new InvokeRecActionCommand { ProfileId = profileId });
}