ISender.cs 715 B

1234567891011121314151617181920
  1. namespace Application.Abstractions.Messaging;
  2. /// <summary>
  3. /// Command/Query를 적절한 Handler로 디스패치합니다. (MediatR ISender 대체)
  4. /// </summary>
  5. public interface ISender
  6. {
  7. /// <summary>반환값이 있는 Command/Query를 처리합니다.</summary>
  8. Task<TResponse> Send<TResponse>(IRequest<TResponse> request, CancellationToken cancellationToken = default);
  9. /// <summary>반환값이 없는 Command를 처리합니다.</summary>
  10. Task Send(IRequest request, CancellationToken cancellationToken = default);
  11. }
  12. /// <summary>
  13. /// 기존 MediatR IMediator 호출부 호환용입니다. ISender와 동일하게 동작합니다.
  14. /// </summary>
  15. public interface IMediator : ISender
  16. {
  17. }