Interface IQuery<TQuery, TResponse, TEndPointDefinition>
Represents a query interface that defines the contract for handling a specific query and its corresponding response sent over a specific endpoint (Exchange or Queue).
public interface IQuery<TQuery, TResponse, TEndPointDefinition> : _IRequest<TQuery, TResponse, TEndPointDefinition>, _IMessage<TQuery, TResponse, TEndPointDefinition>, _IQuery<TQuery, TResponse>, _IRequest<TQuery, TResponse>, _IMessage<TQuery, TResponse> where TQuery : IQuery<TQuery, TResponse, TEndPointDefinition> where TResponse : class where TEndPointDefinition : EndPointBase, new()
Type Parameters
TQueryThe type of the query.
TResponseThe type of the query response.
TEndPointDefinitionThe type of the endpoint definition where the query will be sent to (should inherit from ExchangeEndPoint or QueueEndPoint).
Examples
Example of a query definition
public class RetrieveDataQuery : IQuery<RetrieveDataQuery, RetrieveDataQuery.Response, MyExchangeEndPoint>
{
public RetrieveDataQuery(string queryParameter)
{
QueryParameter = queryParameter;
}
public string QueryParameter { get; set; }
public class Response
{
public string ResultData { get; set; }
}
}