Table of Contents

Interface IQuery<TQuery, TResponse, TEndPointDefinition>

Namespace
CarrotMQ.Core.Dto
Assembly
CarrotMQ.Core.dll

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

TQuery

The type of the query.

TResponse

The type of the query response.

TEndPointDefinition

The 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; }
    }
}

See Also

_IRequest<TRequest, TResponse, TEndPointDefinition>
_IQuery<TQuery, TResponse>