IRequestFor<T>
IRequestFor<T> indicates result type of the request.
/// <summary>Indicates expected result type.</summary>
/// <typeparam name="ResultType"></typeparam>
public interface IRequestFor<out ResultType> : IRequest, IRequestForT { }
Request class inherites IRequestFor<T> to indicate result type.
/// <summary>Request to print record-like object as json-string</summary>
public record PrintAsJson(Object record) : IRequestFor<string>;
IRequestForType
IRequestForType uses property to express expected result type.
/// <summary>Indicates that there is a specific result type.</summary>
public interface IRequestForType : IRequestFor
{
/// <summary>Get Result Type, if available</summary>
Type? ResultType { get; }
}
.ResultType returns the result type.
/// <summary>Request to print record-like object as json-string</summary>
public record PrintAsJson(Object record) : IRequestForType
{
Type? IRequestForType.ResultType => typeof(string);
}