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:
parent
2cf4d73cf3
commit
5697eb3dd8
@ -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 });
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user