dev
Line | |
---|
1 | using MediatR;
|
---|
2 | using FinkiChattery.Common.Mediator.Contracs;
|
---|
3 | using FinkiChattery.Common.Mediator.Interfaces;
|
---|
4 | using System.Threading;
|
---|
5 | using System.Threading.Tasks;
|
---|
6 |
|
---|
7 | namespace 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.