Update to .net core
This commit is contained in:
@@ -55,9 +55,9 @@ Decouples sender and receiver (as a sender you don't know who will handle the re
|
||||
Hierarchical in nature
|
||||
When using the Chain of Responsibility is more effective:
|
||||
More than one object can handle a command
|
||||
The handler is not known in advance
|
||||
The handler is not known in advances
|
||||
The handler should be determined automatically
|
||||
It’s wished that the request is addressed to a group of objects without explicitly specifying its receiver
|
||||
It's wished that the request is addressed to a group of objects without explicitly specifying its receiver
|
||||
The group of objects that may handle the command must be specified in a dynamic way.
|
||||
Examples in real life:
|
||||
-java.util.logging.Logger.#log()
|
||||
|
||||
@@ -9,15 +9,15 @@ namespace ChainOfResponssibility.Validators.UserEntities
|
||||
{
|
||||
UserRepository userRepository;
|
||||
PrincipalHelper principalHelper;
|
||||
Operation operation;
|
||||
Operation inputOperation;
|
||||
ChainValidation<User> userCreationValidation;
|
||||
ChainValidation<User> authenticateUserValidation;
|
||||
public UserProcessor()
|
||||
{
|
||||
userRepository = new UserRepository();
|
||||
principalHelper = new PrincipalHelper();
|
||||
operation = new AuthenticateOperation(AuthenticateUser);
|
||||
operation.SetSuccessor(new CreateNewUserOperation(CreateNewUser));
|
||||
inputOperation = new AuthenticateOperation(AuthenticateUser);
|
||||
inputOperation.SetSuccessor(new CreateNewUserOperation(CreateNewUser));
|
||||
|
||||
userCreationValidation = new IsAuthorisedToDoOperationsOnUser(principalHelper, Rights.Create);
|
||||
userCreationValidation.SetSuccessor(new ValidateNoDuplicateEmail(userRepository));
|
||||
@@ -55,12 +55,12 @@ namespace ChainOfResponssibility.Validators.UserEntities
|
||||
string userInput;
|
||||
do
|
||||
{
|
||||
operation.PrintMenu();
|
||||
inputOperation.PrintMenu();
|
||||
Console.Write(">");
|
||||
userInput = Console.ReadLine();
|
||||
|
||||
if (!IsExitCode(userInput))
|
||||
operation.Execute(userInput);
|
||||
inputOperation.Execute(userInput);
|
||||
|
||||
} while (!IsExitCode(userInput));
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
{
|
||||
"version": "1.0.0-*",
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.5.0-rc2-24027"
|
||||
"NETStandard.Library": "1.6.0"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
|
||||
Reference in New Issue
Block a user