Created
September 3, 2026 06:40
-
-
Save somapatrik/007c313b7884fd065d897ecf752abae6 to your computer and use it in GitHub Desktop.
Rider - File template - CommandHandler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Mediator; | |
| namespace $NAMESPACE$; | |
| public class $CLASS$ : ICommandHandler<$COMMAND$> | |
| { | |
| private readonly IUnitOfWorkFactory _unitOfWorkFactory; | |
| public $CLASS$(IUnitOfWorkFactory unitOfWorkFactory) | |
| { | |
| _unitOfWorkFactory = unitOfWorkFactory; | |
| } | |
| public async ValueTask<Unit> Handle($COMMAND$ command, CancellationToken cancellationToken) | |
| { | |
| await using var unitOfWork = _unitOfWorkFactory.Create(); | |
| return Unit.Value; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment