Update to .net core
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>e3092ee0-1282-4ab4-9fa2-0338348d8fd1</ProjectGuid>
|
||||
<ProjectGuid>7843b0f8-7530-4859-8bee-43d370e0f0aa</ProjectGuid>
|
||||
<RootNamespace>BehavioralPatterns</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using ChainOfResponssibility;
|
||||
using ChainOfResponssibility.PurchaseExample;
|
||||
using CommandPattern;
|
||||
using IteratorPattern;
|
||||
using MediatorPattern;
|
||||
@@ -7,7 +6,6 @@ using MememntoPattern;
|
||||
using ObserverPattern;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -17,9 +15,6 @@ namespace BehavioralPatterns
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
|
||||
ObserverPatternExamples.Run();
|
||||
Console.ReadKey();
|
||||
//Chain of responsibillity
|
||||
//This is usefull when you have a request and you don't know who should process it
|
||||
ChainOfResponsibillityExamples.Run();
|
||||
@@ -42,6 +37,10 @@ namespace BehavioralPatterns
|
||||
Console.ReadKey();
|
||||
|
||||
MementoPatternExamples.Run();
|
||||
|
||||
|
||||
ObserverPatternExamples.Run();
|
||||
Console.ReadKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,4 +16,4 @@ using System.Runtime.InteropServices;
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("e3092ee0-1282-4ab4-9fa2-0338348d8fd1")]
|
||||
[assembly: Guid("7843b0f8-7530-4859-8bee-43d370e0f0aa")]
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
{
|
||||
{
|
||||
"version": "1.0.0-*",
|
||||
"buildOptions": {
|
||||
"emitEntryPoint": true,
|
||||
"copyToOutput": {
|
||||
"include": "../IteratorPattern/FileExample/SampleFiles/**"
|
||||
}
|
||||
"emitEntryPoint": true
|
||||
},
|
||||
|
||||
"dependencies": {
|
||||
@@ -15,7 +12,7 @@
|
||||
"MememntoPattern": "1.0.0-*",
|
||||
"Microsoft.NETCore.App": {
|
||||
"type": "platform",
|
||||
"version": "1.0.0-rc2-3002702"
|
||||
"version": "1.0.0"
|
||||
},
|
||||
"ObserverPattern": "1.0.0-*"
|
||||
},
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
{
|
||||
{
|
||||
"version": "1.0.0-*",
|
||||
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"type": "platform",
|
||||
"version": "1.0.0-rc2-3002702"
|
||||
}
|
||||
"Microsoft.NETCore.App": "1.0.0"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
{
|
||||
"version": "1.0.0-*",
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.5.0-rc2-24027"
|
||||
"NETStandard.Library": "1.6.0"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
{
|
||||
"version": "1.0.0-*",
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.5.0-rc2-24027"
|
||||
"NETStandard.Library": "1.6.0"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.5.0-rc2-24027",
|
||||
"Newtonsoft.Json": "8.0.3",
|
||||
"System.Runtime.Serialization.Primitives": "4.0.10-*"
|
||||
"Newtonsoft.Json": "9.0.1",
|
||||
"System.Runtime.Serialization.Primitives": "4.1.1"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
|
||||
@@ -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