Answer the question
In order to leave comments, you need to log in
Error while implementing Generic interface in C#. How to decide?
There is the following code:
public interface IRequest<out TResponse>{}
public interface IPagedRequest<out TResponse>: IRequest<IPagedList<TResponse>> {
int Page { get; set; }
int PageSize { get; set; }
}
public interface IRequestHandler<in TRequest, TResponse> where TRequest : class, IRequest<TResponse> {
Task<TResponse> HandleAsync(TRequest request, CancellationToken cancellationToken = default(CancellationToken));
}
public class PagedRequestHandler<TRequest, TResponse> : IRequestHandler<TRequest, TResponse> where TRequest : class, IPagedRequest<TResponse> {
// ...
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question