Skip to content

Instantly share code, notes, and snippets.

@somapatrik
Created September 3, 2026 06:40
Show Gist options
  • Select an option

  • Save somapatrik/007c313b7884fd065d897ecf752abae6 to your computer and use it in GitHub Desktop.

Select an option

Save somapatrik/007c313b7884fd065d897ecf752abae6 to your computer and use it in GitHub Desktop.
Rider - File template - CommandHandler
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