-
Notifications
You must be signed in to change notification settings - Fork 38
Polymorphic RequestHandler #33
Copy link
Copy link
Open
Description
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.
You can view a full test here: https://gist.github.com/michelgrootjans/284aa97119a9daa4ea1a
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels