Is it possible to have a more generic handler that can handle multiple types of requests. For example:
public class ParentRequest : Request{ }
public class ChildRequest : ParentRequest { }
public class TestRequestHandler : RequestHandler<ParentRequest, TestResponse>
{
public override Response Handle(ParentRequest request)
{
return new TestResponse();
}
}
This TestRequestHandler would then be able to handle a ChildRequest too.
Is it possible to have a more generic handler that can handle multiple types of requests. For example:
This
TestRequestHandler
would then be able to handle aChildRequest
too.You can view a full test here: https://gist.github.com/michelgrootjans/284aa97119a9daa4ea1a