-
Notifications
You must be signed in to change notification settings - Fork 1
/
IRequestHandler.cs
45 lines (42 loc) · 1.35 KB
/
IRequestHandler.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using ServiceAnt.Handler;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ServiceAnt.Request.Handler
{
/// <summary>
/// The inerface of handling request
/// </summary>
public interface IRequestHandler : IHandler
{
}
/// <summary>
/// The interface of handling request
/// </summary>
/// <typeparam name="TRequest">request parameter</typeparam>
public interface IRequestHandler<TRequest> : IRequestHandler where TRequest : TransportTray
{
/// <summary>
/// Handle request async
/// </summary>
/// <param name="param">request</param>
/// <param name="handlerContext">handler context</param>
/// <returns></returns>
Task HandleAsync(TRequest param, IRequestHandlerContext handlerContext);
}
/// <summary>
/// The interface of handling request with dynamic parameter
/// </summary>
public interface IDynamicRequestHandler : IRequestHandler
{
/// <summary>
/// Handle request async
/// </summary>
/// <param name="param">dynamic request parameter</param>
/// <param name="handlerContext">handler context</param>
/// <returns></returns>
Task HandleAsync(dynamic param, IRequestHandlerContext handlerContext);
}
}