Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (32 sloc) 1.08 KB
namespace CleanArchitecture.Core.Contracts
{
/// <summary>
/// Defines a handler for a request
/// </summary>
/// <typeparam name="TRequest">The type of request being handled</typeparam>
/// <typeparam name="TResponse">The type of response from the handler</typeparam>
public interface IRequestHandler<in TRequest, out TResponse>
where TRequest : IRequest<TResponse>
{
/// <summary>
/// Handles a request
/// </summary>
/// <param name="message">The request message</param>
/// <returns>Response from the request</returns>
TResponse Handle(TRequest message);
}
/// <summary>
/// Defines a handler for a request without a return value
/// </summary>
/// <typeparam name="TRequest">The type of request being handled</typeparam>
public interface IRequestHandler<in TRequest>
where TRequest : IRequest
{
/// <summary>
/// Handles a request
/// </summary>
/// <param name="message">The request message</param>
void Handle(TRequest message);
}
}