source: src/FinkiChattery/FinkiChattery.Common/Mediator/MediatorService.cs@ 5cbb557

dev
Last change on this file since 5cbb557 was e6a6d9a, checked in by Стојков Марко <mst@…>, 3 years ago

Initialized FinkiChattery project

  • Property mode set to 100644
File size: 800 bytes
Line 
1using MediatR;
2using FinkiChattery.Common.Mediator.Contracs;
3using FinkiChattery.Common.Mediator.Interfaces;
4using System.Threading;
5using System.Threading.Tasks;
6
7namespace FinkiChattery.Common.Mediator
8{
9 public class MediatorService : IMediatorService
10 {
11 private readonly IMediator mediator;
12
13 public MediatorService(IMediator mediator)
14 {
15 this.mediator = mediator;
16 }
17
18 public async Task<TResponse> SendAsync<TResponse>(ICommand<TResponse> request, CancellationToken cancellationToken)
19 {
20 return await mediator.Send(request, cancellationToken);
21 }
22
23 public async Task<TResponse> SendAsync<TResponse>(ICommand<TResponse> request)
24 {
25 return await mediator.Send(request);
26 }
27 }
28}
Note: See TracBrowser for help on using the repository browser.