Update to .net core

This commit is contained in:
Petrutiu Mihai
2016-06-28 11:35:15 +03:00
parent d47e43aaa5
commit 4a69b3da17
13 changed files with 36 additions and 43 deletions

View File

@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{3820200F-354C-41E6-8F34-B301F5D621C2}"
EndProject
@@ -10,8 +10,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
global.json = global.json
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "BehavioralPatterns", "src\BehavioralPatterns\BehavioralPatterns.xproj", "{E3092EE0-1282-4AB4-9FA2-0338348D8FD1}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ChainOfResponssibility", "src\ChainOfResponssibility\ChainOfResponssibility.xproj", "{89536824-683F-4351-8789-406D7BDD922D}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "CommandPattern", "src\CommandPattern\CommandPattern.xproj", "{454B2A43-8251-4667-8DE3-67E489908DB9}"
@@ -24,16 +22,14 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MememntoPattern", "src\Meme
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ObserverPattern", "src\ObserverPattern\ObserverPattern.xproj", "{D48DB558-0228-4ACE-88A8-A202E5C57849}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "BehavioralPatterns", "src\BehavioralPatterns\BehavioralPatterns.xproj", "{7843B0F8-7530-4859-8BEE-43D370E0F0AA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E3092EE0-1282-4AB4-9FA2-0338348D8FD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E3092EE0-1282-4AB4-9FA2-0338348D8FD1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E3092EE0-1282-4AB4-9FA2-0338348D8FD1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E3092EE0-1282-4AB4-9FA2-0338348D8FD1}.Release|Any CPU.Build.0 = Release|Any CPU
{89536824-683F-4351-8789-406D7BDD922D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{89536824-683F-4351-8789-406D7BDD922D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{89536824-683F-4351-8789-406D7BDD922D}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -58,17 +54,21 @@ Global
{D48DB558-0228-4ACE-88A8-A202E5C57849}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D48DB558-0228-4ACE-88A8-A202E5C57849}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D48DB558-0228-4ACE-88A8-A202E5C57849}.Release|Any CPU.Build.0 = Release|Any CPU
{7843B0F8-7530-4859-8BEE-43D370E0F0AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7843B0F8-7530-4859-8BEE-43D370E0F0AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7843B0F8-7530-4859-8BEE-43D370E0F0AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7843B0F8-7530-4859-8BEE-43D370E0F0AA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{E3092EE0-1282-4AB4-9FA2-0338348D8FD1} = {3820200F-354C-41E6-8F34-B301F5D621C2}
{89536824-683F-4351-8789-406D7BDD922D} = {3820200F-354C-41E6-8F34-B301F5D621C2}
{454B2A43-8251-4667-8DE3-67E489908DB9} = {3820200F-354C-41E6-8F34-B301F5D621C2}
{6F3B7F9A-4D9C-4506-A5F7-3FF5CF4376BD} = {3820200F-354C-41E6-8F34-B301F5D621C2}
{2A63BD0A-9D07-4755-9B16-5DDBEB075B80} = {3820200F-354C-41E6-8F34-B301F5D621C2}
{1DE3FDD3-D025-49D8-BEF4-D5F0688F89E8} = {3820200F-354C-41E6-8F34-B301F5D621C2}
{D48DB558-0228-4ACE-88A8-A202E5C57849} = {3820200F-354C-41E6-8F34-B301F5D621C2}
{7843B0F8-7530-4859-8BEE-43D370E0F0AA} = {3820200F-354C-41E6-8F34-B301F5D621C2}
EndGlobalSection
EndGlobal

View File

@@ -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>

View File

@@ -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();
}
}
}

View File

@@ -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")]

View File

@@ -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-*"
},

View File

@@ -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
Its 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()

View File

@@ -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));
}

View File

@@ -1,8 +1,8 @@
{
{
"version": "1.0.0-*",
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027"
"NETStandard.Library": "1.6.0"
},
"frameworks": {

View File

@@ -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": {

View File

@@ -1,8 +1,8 @@
{
{
"version": "1.0.0-*",
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027"
"NETStandard.Library": "1.6.0"
},
"frameworks": {

View File

@@ -1,8 +1,8 @@
{
{
"version": "1.0.0-*",
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027"
"NETStandard.Library": "1.6.0"
},
"frameworks": {

View File

@@ -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": {

View File

@@ -1,8 +1,8 @@
{
{
"version": "1.0.0-*",
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027"
"NETStandard.Library": "1.6.0"
},
"frameworks": {