Created
January 21, 2019 23:42
-
-
Save MarcoNicolodi/53d7ce6e112943b558d977677f142fd6 to your computer and use it in GitHub Desktop.
ChainOfResponsibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class RuleHandler<TRequest, TReturn> | |
{ | |
private RuleHandler<TRequest, TReturn> _nextHandler; | |
public RuleHandler<TRequest, TReturn> SetNext(RuleHandler<TRequest, TReturn> handler) | |
{ | |
_nextHandler = handler; | |
return _nextHandler; | |
} | |
public virtual TReturn Run(TRequest request) => _nextHandler.Run(request); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment