I wanted to make a simple and understandable example
if you call a method like this, your client will not know return type
var interestPoints = Mediator.Handle(new InterestPointTypeRequest
{
LanguageCode = request.LanguageCode,
AgentId = request.AgentId,
InterestPointId = request.InterestPointId,
});
Then you should say to compiler i know the return type is List<InterestPointTypeMap>
var interestPoints = Mediator.Handle<List<InterestPointTypeMap>>(new InterestPointTypeRequest
{
LanguageCode = request.LanguageCode,
AgentId = request.AgentId,
InterestPointId = request.InterestPointId,
InterestPointTypeId = request.InterestPointTypeId
});
the compiler will no longer be mad at you for knowing the return type