├── .vscode ├── launch.json └── tasks.json ├── Builder ├── Car.cs ├── Director.cs ├── IBuilder.cs ├── MotorCycle .cs └── Product.cs ├── DesignPatterns.csproj ├── Factory ├── BankA.cs ├── BankB.cs ├── BankFactory.cs ├── IBank.cs ├── IBankFactory.cs ├── IPaymentCard.cs └── PaymentCardFactory.cs ├── Modern Software Design Patterns 2.pptx ├── Program.cs ├── Prototype ├── Address.cs ├── EmployeePrototype.cs ├── RegEmployee.cs └── TempEmployee.cs ├── Singleton └── Counter.cs ├── StructuralPatterns ├── Adapter │ ├── Employee.cs │ ├── MachineOperator.cs │ ├── SalaryAdapter.cs │ └── SalaryCalculator.cs ├── Decorator │ ├── AbstractDecorator.cs │ └── NotificationEmailDecorator.cs ├── Facade │ ├── BasketItem.cs │ ├── Inventory.cs │ ├── InventoryOrder.cs │ ├── PaymentProcessor.cs │ ├── PurchaseInvoice.cs │ ├── PurchaseOrder.cs │ ├── ShoppingBasket.cs │ └── SmsNotifications.cs ├── Flyweight │ ├── DayDiscountCalc.cs │ ├── DiscountCalcFactory.cs │ ├── IDiscountCalaculator.cs │ └── ItemPriceCalc.cs └── Proxy │ ├── ConcereteSMSService.cs │ ├── SMSService.cs │ └── SMSServiceProxy.cs ├── bin └── Debug │ └── netcoreapp3.1 │ ├── DesignPatterns.deps.json │ ├── DesignPatterns.dll │ ├── DesignPatterns.exe │ ├── DesignPatterns.pdb │ ├── DesignPatterns.runtimeconfig.dev.json │ ├── DesignPatterns.runtimeconfig.json │ └── Newtonsoft.Json.dll └── obj ├── Debug └── netcoreapp3.1 │ ├── .NETCoreApp,Version=v3.1.AssemblyAttributes.cs │ ├── DesignPatterns.AssemblyInfo.cs │ ├── DesignPatterns.AssemblyInfoInputs.cache │ ├── DesignPatterns.assets.cache │ ├── DesignPatterns.csproj.CopyComplete │ ├── DesignPatterns.csproj.CoreCompileInputs.cache │ ├── DesignPatterns.csproj.FileListAbsolute.txt │ ├── DesignPatterns.csprojAssemblyReference.cache │ ├── DesignPatterns.dll │ ├── DesignPatterns.exe │ ├── DesignPatterns.genruntimeconfig.cache │ └── DesignPatterns.pdb ├── DesignPatterns.csproj.nuget.dgspec.json ├── DesignPatterns.csproj.nuget.g.props ├── DesignPatterns.csproj.nuget.g.targets ├── project.assets.json └── project.nuget.cache /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (console)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/DesignPatterns.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}", 16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console 17 | "console": "internalConsole", 18 | "stopAtEntry": false 19 | }, 20 | { 21 | "name": ".NET Core Attach", 22 | "type": "coreclr", 23 | "request": "attach", 24 | "processId": "${command:pickProcess}" 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/DesignPatterns.csproj", 11 | "/property:GenerateFullPaths=true", 12 | "/consoleloggerparameters:NoSummary" 13 | ], 14 | "problemMatcher": "$msCompile" 15 | }, 16 | { 17 | "label": "publish", 18 | "command": "dotnet", 19 | "type": "process", 20 | "args": [ 21 | "publish", 22 | "${workspaceFolder}/DesignPatterns.csproj", 23 | "/property:GenerateFullPaths=true", 24 | "/consoleloggerparameters:NoSummary" 25 | ], 26 | "problemMatcher": "$msCompile" 27 | }, 28 | { 29 | "label": "watch", 30 | "command": "dotnet", 31 | "type": "process", 32 | "args": [ 33 | "watch", 34 | "run", 35 | "${workspaceFolder}/DesignPatterns.csproj", 36 | "/property:GenerateFullPaths=true", 37 | "/consoleloggerparameters:NoSummary" 38 | ], 39 | "problemMatcher": "$msCompile" 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /Builder/Car.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.Builder 2 | { 3 | // Concrete Builder 4 | public class Car : IBuilder 5 | { 6 | private string brandName; 7 | private Product product; 8 | public Car(string brand) 9 | { 10 | product = new Product(); 11 | this.brandName = brand; 12 | } 13 | public void StartUpOperations() 14 | { 15 | product.Add($"Car Model name :{this.brandName}"); 16 | } 17 | public void BuildBody() { product.Add("Body of car was added"); } 18 | public void InsertWheels() { product.Add("wheels are added"); } 19 | public void AddHeadlights() 20 | { 21 | product.Add("Headlights are added"); 22 | } 23 | public void EndOperations(){ /*End Operation*/ } 24 | public Product GetVehicle() { return product; } 25 | } 26 | } -------------------------------------------------------------------------------- /Builder/Director.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.Builder 2 | { 3 | public class Director 4 | { 5 | IBuilder builder; 6 | // steps to create complex object 7 | public void Construct(IBuilder builder){ 8 | this.builder = builder; 9 | builder.StartUpOperations(); 10 | builder.BuildBody(); 11 | builder.InsertWheels(); 12 | builder.AddHeadlights(); 13 | builder.EndOperations(); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Builder/IBuilder.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.Builder 2 | { 3 | // Builders Interface 4 | public interface IBuilder 5 | { 6 | void StartUpOperations(); 7 | void BuildBody(); 8 | void InsertWheels(); 9 | void AddHeadlights(); 10 | void EndOperations(); 11 | Product GetVehicle(); 12 | } 13 | } -------------------------------------------------------------------------------- /Builder/MotorCycle .cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.Builder 2 | { 3 | public class MotorCycle : IBuilder 4 | { 5 | private string brandName; 6 | private Product product; 7 | public MotorCycle(string brand) 8 | { 9 | product = new Product(); 10 | this.brandName = brand; 11 | } 12 | public void StartUpOperations() {/*Start*/} 13 | public void BuildBody() 14 | { 15 | product.Add("Body was added"); 16 | } 17 | public void InsertWheels() 18 | { 19 | product.Add("wheels are added"); 20 | } 21 | public void AddHeadlights() 22 | { 23 | product.Add("Headlights are added"); 24 | } 25 | public void EndOperations() 26 | { 27 | product.Add($"Motorcycle brand name {this.brandName}"); 28 | } 29 | public Product GetVehicle() { return product; } 30 | } 31 | } -------------------------------------------------------------------------------- /Builder/Product.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.Builder 2 | { 3 | public class Product 4 | { 5 | private System.Collections.Generic.LinkedList parts; 6 | public Product() { parts = new System.Collections.Generic.LinkedList(); } 7 | public void Add(string part) 8 | { 9 | //Add parts 10 | parts.AddLast(part); 11 | } 12 | public string Show() 13 | { 14 | System.Text.StringBuilder result = new System.Text.StringBuilder(); 15 | result.AppendLine("Product components are :"); 16 | foreach (string part in parts) 17 | result.AppendLine(part); 18 | 19 | return result.ToString(); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /DesignPatterns.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Exe 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Factory/BankA.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.Factory 2 | { 3 | public class BankA:IBank 4 | { 5 | public string Withdraw() 6 | { 7 | return "Your request is handling by BankA"; 8 | } 9 | 10 | 11 | } 12 | } -------------------------------------------------------------------------------- /Factory/BankB.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.Factory 2 | { 3 | public class BankB:IBank 4 | { 5 | public string Withdraw(){ 6 | return "Your request is handling by BankB"; 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /Factory/BankFactory.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.Factory 2 | { 3 | public class BankFactory : IBankFactory 4 | { 5 | public IBank GetBank(string bankCode) 6 | { 7 | switch(bankCode){ 8 | case "123456" : return new BankA(); 9 | case "111111" : return new BankB(); 10 | } 11 | return null; 12 | } 13 | 14 | public IPaymentCard GetPaymentCard(string cardNumber) 15 | { 16 | switch(cardNumber){ 17 | case "12" : return new VisaCard(); 18 | case "34" : return new MasterCard(); 19 | } 20 | return null; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Factory/IBank.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.Factory 2 | { 3 | public interface IBank 4 | { 5 | string Withdraw(); 6 | } 7 | } -------------------------------------------------------------------------------- /Factory/IBankFactory.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.Factory 2 | { 3 | public interface IBankFactory 4 | { 5 | IBank GetBank(string bankCode); 6 | IPaymentCard GetPaymentCard(string cardNumber); 7 | 8 | } 9 | } -------------------------------------------------------------------------------- /Factory/IPaymentCard.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.Factory 2 | { 3 | public interface IPaymentCard 4 | { 5 | string GetName(); 6 | string GetProviderInfo(); 7 | } 8 | 9 | public class VisaCard : IPaymentCard 10 | { 11 | public string GetName() 12 | { 13 | return "Visa Card"; 14 | } 15 | 16 | public string GetProviderInfo() 17 | { 18 | return "Visa"; 19 | } 20 | } 21 | 22 | public class MasterCard : IPaymentCard 23 | { 24 | public string GetName() 25 | { 26 | return "Master Card"; 27 | } 28 | 29 | public string GetProviderInfo() 30 | { 31 | return "MasterCard"; 32 | } 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /Factory/PaymentCardFactory.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.Factory 2 | { 3 | public class PaymentCardFactory 4 | { 5 | 6 | } 7 | } -------------------------------------------------------------------------------- /Modern Software Design Patterns 2.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Eng-MohammedReda/Design-Patterns/c9d5f709f2bababdb87b3db52a76fa39319fe9b5/Modern Software Design Patterns 2.pptx -------------------------------------------------------------------------------- /Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Xml.XPath; 6 | using DesignPatterns.Builder; 7 | using DesignPatterns.Factory; 8 | using DesignPatterns.Prototype; 9 | using DesignPatterns.Singleton; 10 | using DesignPatterns.StructuralPatterns.Adapter; 11 | using DesignPatterns.StructuralPatterns.Facade; 12 | using Newtonsoft.Json; 13 | 14 | namespace DesignPatterns 15 | { 16 | class Program 17 | { 18 | static void WriteColoredLine( 19 | string text, ConsoleColor color = ConsoleColor.Green) 20 | { 21 | Console.ForegroundColor =color ; 22 | Console.WriteLine(text); 23 | } 24 | 25 | static void Main(string[] args) 26 | { 27 | #region Creational Patterns 28 | #region singleton 29 | /* Task task1 = Task.Factory.StartNew(() => { 30 | Counter counter1 = Counter.GetInstance(); 31 | counter1.AddOne(); 32 | Console.WriteLine("counter 1 :"+ counter1.count.ToString()); 33 | }); 34 | 35 | Task task2 = Task.Factory.StartNew(() => { 36 | Counter counter2 = Counter.GetInstance(); 37 | counter2.AddOne(); 38 | Console.WriteLine("counter 2 :"+ counter2.count.ToString()); 39 | Console.WriteLine(); 40 | }); */ 41 | //counter1.AddOne(); 42 | //Console.WriteLine("counter 1 :"+ counter1.count.ToString()); 43 | //Console.WriteLine("counter 2 :"+ counter2.count.ToString()); 44 | #endregion 45 | 46 | #region prototype 47 | /*EmployeePrototype tempEmp1 = new TempEmployee(); 48 | tempEmp1.Name = "temp employee 1"; 49 | tempEmp1.Id = 1; 50 | tempEmp1.EmpAddress = new Address{City="city 1", Building="B1", StreetName="street name"}; 51 | 52 | EmployeePrototype tempEmp2 =tempEmp1.ShallowCopy(); 53 | 54 | Console.WriteLine("========= Temp Emp 1 Original Values============="); 55 | Console.WriteLine(tempEmp1.ToString()); 56 | Console.WriteLine("========= Temp Emp 2 Copy========================"); 57 | Console.WriteLine(tempEmp2.ToString()); 58 | 59 | tempEmp2.EmpAddress.City="new city"; 60 | tempEmp2.Name="sadasdasd"; 61 | tempEmp2.Id=1000; 62 | Console.ForegroundColor = ConsoleColor.Cyan; 63 | Console.WriteLine("========= Temp Emp 1 After Change ============="); 64 | Console.WriteLine(tempEmp1.ToString()); 65 | Console.WriteLine("========= Temp Emp 2 =========================="); 66 | Console.WriteLine(tempEmp2.ToString());*/ 67 | 68 | #endregion 69 | 70 | #region Builder 71 | /*System.Text.StringBuilder sb =new System.Text.StringBuilder(); 72 | sb.Append("Word 1,"); 73 | sb.Append("Word 2"); 74 | 75 | WriteColoredLine(sb.ToString(),ConsoleColor.Cyan);*/ 76 | /*WriteColoredLine("***Builder Pattern***",ConsoleColor.Yellow); 77 | Director director = new Director(); 78 | IBuilder carBuilder = new Car("Jeep"); 79 | IBuilder motorCycleBuilder = new MotorCycle("Honda");*/ 80 | 81 | // Making Car 82 | /*director.Construct(carBuilder); 83 | Product car = carBuilder.GetVehicle(); 84 | WriteColoredLine($"Car {car.Show()}"); 85 | 86 | //Making MotorCycle 87 | director.Construct(motorCycleBuilder); 88 | Product motorCycle = motorCycleBuilder.GetVehicle(); 89 | WriteColoredLine($"MotorCycle {motorCycle.Show()}");*/ 90 | #endregion 91 | 92 | #region Factory Method 93 | /*string cardNumber,bankCode; 94 | BankFactory bankFactory = new BankFactory (); 95 | 96 | WriteColoredLine("Enter your card number",ConsoleColor.Cyan); 97 | cardNumber=Console.ReadLine(); 98 | bankCode=cardNumber.Substring(0,6); 99 | IBank bank = bankFactory.GetBank(bankCode); 100 | IPaymentCard paymentCard = bankFactory.GetPaymentCard("12"); 101 | 102 | WriteColoredLine(bank.Withdraw()); 103 | WriteColoredLine(paymentCard.GetName());*/ 104 | #endregion 105 | #endregion 106 | 107 | #region Structural Patterns 108 | 109 | #region Proxy 110 | /*StructuralPatterns.SMSServiceProxy proxy = new StructuralPatterns.SMSServiceProxy (); 111 | 112 | WriteColoredLine(proxy.SendSMS("123","01100000","message 1")); 113 | WriteColoredLine(proxy.SendSMS("123","01100000","message 1")); 114 | WriteColoredLine(proxy.SendSMS("123","01100000","message 1"));*/ 115 | #endregion 116 | 117 | #region Decorator 118 | /*StructuralPatterns.ConcereteSMSService smsService = new StructuralPatterns.ConcereteSMSService (); 119 | StructuralPatterns.NotificationEmailDecorator emailDecorator = new StructuralPatterns.NotificationEmailDecorator(); 120 | 121 | emailDecorator.SetService(smsService); 122 | WriteColoredLine(emailDecorator.SendSMS("123","01100000","message 1"));*/ 123 | 124 | #endregion 125 | 126 | #region Adapter 127 | /*Employee emp =new Employee (); 128 | MachineOperator machineOperator=new MachineOperator (); 129 | machineOperator.BasicSalary =1200; 130 | 131 | emp.Name ="test"; emp.BasicSalary=1000; 132 | SalaryAdapter calculator = new SalaryAdapter (); 133 | var salary= calculator.CalcSalary(machineOperator); 134 | WriteColoredLine(salary.ToString());*/ 135 | #endregion 136 | 137 | #region Facade 138 | 139 | /* ShoppingBasket basket =new ShoppingBasket (); 140 | basket.AddItem(new BasketItem {ItemID="123",ItemPrice=50,Quantity=3}); 141 | basket.AddItem(new BasketItem {ItemID="456",ItemPrice=40,Quantity=2}); 142 | 143 | PurchaseOrder order = new PurchaseOrder (); 144 | order.CreateOrder(basket,"name:mohammed,bank:123456789,mobile:0100000"); 145 | */ 146 | 147 | 148 | #endregion 149 | 150 | #region Flyweight 151 | DiscountCalcFactory discountFactory = new DiscountCalcFactory (); 152 | var calculator = discountFactory.GetDiscountCalc("day"); 153 | var val=calculator.GetDiscountValue(DateTime.Now.Date); 154 | WriteColoredLine(val.ToString()); 155 | #endregion 156 | 157 | #endregion // End of structural patterns 158 | 159 | Console.ReadKey(); 160 | } 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /Prototype/Address.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.Prototype 2 | { 3 | public class Address 4 | { 5 | public string Building {get;set;} 6 | public string StreetName {get;set;} 7 | public string City {get;set;} 8 | 9 | } 10 | } -------------------------------------------------------------------------------- /Prototype/EmployeePrototype.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.Prototype 2 | { 3 | public abstract class EmployeePrototype 4 | { 5 | public int Id {get;set;} 6 | public string Name {get;set;} 7 | public Address EmpAddress {get;set;} 8 | 9 | public abstract EmployeePrototype ShallowCopy(); 10 | public abstract EmployeePrototype DeepCopy(); 11 | 12 | public override string ToString(){ 13 | return 14 | $@" 15 | Id: {this.Id} 16 | Name: {this.Name} 17 | Address: {this.EmpAddress.City},{this.EmpAddress.StreetName},{this.EmpAddress.Building}"; 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Prototype/RegEmployee.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.Prototype 2 | { 3 | public class RegEmployee : EmployeePrototype 4 | { 5 | public override EmployeePrototype ShallowCopy() 6 | { 7 | return (RegEmployee) this.MemberwiseClone(); 8 | } 9 | 10 | public override EmployeePrototype DeepCopy() 11 | { 12 | RegEmployee emp = new RegEmployee(); 13 | emp = (RegEmployee)this.MemberwiseClone(); 14 | emp.EmpAddress = new Address{ 15 | Building=EmpAddress.Building , 16 | City=EmpAddress.City, 17 | StreetName=EmpAddress.StreetName}; 18 | emp.Name = this.Name; 19 | return emp; 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /Prototype/TempEmployee.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.Prototype 2 | { 3 | public class TempEmployee : EmployeePrototype 4 | { 5 | public override EmployeePrototype ShallowCopy() 6 | { 7 | return (TempEmployee) this.MemberwiseClone(); 8 | } 9 | public override EmployeePrototype DeepCopy() 10 | { 11 | TempEmployee emp = new TempEmployee(); 12 | emp = (TempEmployee)this.MemberwiseClone(); 13 | emp.EmpAddress = new Address{ 14 | Building=EmpAddress.Building , 15 | City=EmpAddress.City, 16 | StreetName=EmpAddress.StreetName}; 17 | emp.Name = this.Name; 18 | return emp; 19 | } 20 | 21 | } 22 | } -------------------------------------------------------------------------------- /Singleton/Counter.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.Singleton 2 | { 3 | public class Counter 4 | { 5 | public int count=0; 6 | private static Counter instance = null; 7 | private static object lockObj = new object (); 8 | private Counter(){} 9 | 10 | public static Counter GetInstance (){ 11 | if(instance == null){ 12 | lock(lockObj){ 13 | if (instance==null) {instance = new Counter();} 14 | } 15 | } 16 | return instance; 17 | } 18 | public void AddOne(){count++;} 19 | } 20 | } -------------------------------------------------------------------------------- /StructuralPatterns/Adapter/Employee.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Xml.Linq; 3 | 4 | namespace DesignPatterns.StructuralPatterns.Adapter 5 | { 6 | public class Employee 7 | { 8 | 9 | public string Name{get;set;} 10 | public double BasicSalary {get;set;} 11 | 12 | } 13 | } -------------------------------------------------------------------------------- /StructuralPatterns/Adapter/MachineOperator.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.StructuralPatterns.Adapter 2 | { 3 | public class MachineOperator 4 | { 5 | public string Name{get;set;} 6 | public double BasicSalary {get;set;} 7 | public string ShiftCode {get;set;} 8 | } 9 | } -------------------------------------------------------------------------------- /StructuralPatterns/Adapter/SalaryAdapter.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.StructuralPatterns.Adapter 2 | { 3 | public class SalaryAdapter :SalaryCalculator 4 | { 5 | private Employee _emp; 6 | public double CalcSalary(MachineOperator _operator){ 7 | _emp=new Employee(); 8 | _emp.BasicSalary = _operator.BasicSalary; 9 | return base.CalcSalary(_emp); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /StructuralPatterns/Adapter/SalaryCalculator.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.StructuralPatterns.Adapter 2 | { 3 | public class SalaryCalculator 4 | { 5 | public double CalcSalary(Employee emp ) => emp.BasicSalary * 1.5; 6 | } 7 | } -------------------------------------------------------------------------------- /StructuralPatterns/Decorator/AbstractDecorator.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.StructuralPatterns 2 | { 3 | public abstract class AbstractDecorator: SMSService 4 | { 5 | protected SMSService notificationService ; 6 | public void SetService(SMSService service){ 7 | notificationService = service; 8 | } 9 | 10 | public override string SendSMS(string custId, string mobile, string sms){ 11 | if(notificationService != null ) 12 | {return notificationService.SendSMS(custId,mobile,sms);} 13 | else {return "Notification service not initialized!";} 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /StructuralPatterns/Decorator/NotificationEmailDecorator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | 4 | namespace DesignPatterns.StructuralPatterns 5 | { 6 | public class NotificationEmailDecorator:AbstractDecorator 7 | { 8 | public string SmsSentNotification(string custId, string sms){ 9 | return $"sms {sms}, sent to {custId}, at {DateTime.Now.ToLongDateString()}"; 10 | } 11 | 12 | public override string SendSMS(string custId, string mobile, string sms) 13 | { 14 | StringBuilder result = new StringBuilder (); 15 | result.AppendLine(base.SendSMS(custId, mobile, sms)); 16 | 17 | // decorator method to send mail 18 | result.AppendLine(SmsSentNotification(custId,sms)); 19 | 20 | return result.ToString(); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /StructuralPatterns/Facade/BasketItem.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.StructuralPatterns.Facade 2 | { 3 | public class BasketItem 4 | { 5 | 6 | public string ItemID {get;set;} 7 | public double ItemPrice{get;set;} 8 | public double Quantity{get;set;} 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /StructuralPatterns/Facade/Inventory.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.StructuralPatterns.Facade 2 | { 3 | public class Inventory 4 | { 5 | public bool CheckItemQuantity(string itemID,double quantity){ 6 | return quantity < 100; 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /StructuralPatterns/Facade/InventoryOrder.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.StructuralPatterns.Facade 2 | { 3 | public class InventoryOrder 4 | { 5 | public string CreateOrder(ShoppingBasket basket,string storeID){ 6 | basket.GetItems(); 7 | return $"Order Number is {System.Guid.NewGuid().ToString()}"; 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /StructuralPatterns/Facade/PaymentProcessor.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.StructuralPatterns.Facade 2 | { 3 | public class PaymentProcessor 4 | { 5 | public bool HandlePayment(double amount,string bankInfo){ 6 | return true; 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /StructuralPatterns/Facade/PurchaseInvoice.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | 3 | namespace DesignPatterns.StructuralPatterns.Facade 4 | { 5 | public class PurchaseInvoice 6 | { 7 | 8 | public double discount =0; 9 | public double totalAmount=0; 10 | public double netTotal =0; 11 | public PurchaseInvoice CreateInvoce(ShoppingBasket basket, 12 | string customerInfo){ 13 | var invoice = new PurchaseInvoice(); 14 | var items =basket.GetItems(); 15 | foreach(BasketItem item in items){ 16 | invoice.totalAmount += item.ItemPrice * item.Quantity; 17 | } 18 | 19 | // applay discount 20 | if(items.Count> 5) invoice.discount = 20; 21 | 22 | invoice.netTotal = invoice.totalAmount - invoice.discount; 23 | return invoice; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /StructuralPatterns/Facade/PurchaseOrder.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.StructuralPatterns.Facade 2 | { 3 | public class PurchaseOrder 4 | { 5 | public bool CreateOrder(ShoppingBasket basket, 6 | string custInfo){ 7 | // check stock 8 | bool isAvailable =true; 9 | Inventory inventory = new Inventory (); 10 | 11 | foreach(var item in basket.GetItems()){ 12 | if(!inventory.CheckItemQuantity(item.ItemID,item.Quantity)) 13 | isAvailable=false ; 14 | } 15 | 16 | if(isAvailable){ 17 | // Create Inventory Order 18 | InventoryOrder inventoryOrder=new InventoryOrder (); 19 | inventoryOrder.CreateOrder(basket,"123"); 20 | 21 | // Create Invoice 22 | PurchaseInvoice invoice = new PurchaseInvoice (); 23 | var inv=invoice.CreateInvoce(basket,"address:132,id=456,email=xyz"); 24 | 25 | // Payment 26 | PaymentProcessor payment=new PaymentProcessor (); 27 | payment.HandlePayment(inv.netTotal,"acc=123456789"); 28 | 29 | // Send SMS 30 | SmsNotifications sms=new SmsNotifications (); 31 | sms.SendSms("123","Invoice Created"); 32 | 33 | return true; 34 | }else {return false ;} 35 | 36 | 37 | 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /StructuralPatterns/Facade/ShoppingBasket.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | 4 | namespace DesignPatterns.StructuralPatterns.Facade 5 | { 6 | public class ShoppingBasket 7 | { 8 | private List _items = new List(); 9 | public void AddItem(BasketItem item) 10 | { 11 | _items.Add(item); 12 | } 13 | 14 | public void RemoveOneItem(string itemID) 15 | { 16 | var item = _items.Where(x => x.ItemID == itemID).Single(); 17 | if (item.Quantity > 0) item.Quantity = item.Quantity - 1; 18 | } 19 | 20 | public List GetItems() { return _items; } 21 | 22 | } 23 | } -------------------------------------------------------------------------------- /StructuralPatterns/Facade/SmsNotifications.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.StructuralPatterns.Facade 2 | { 3 | public class SmsNotifications 4 | { 5 | public void SendSms(string to,string msg){ 6 | // send sms 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /StructuralPatterns/Flyweight/DayDiscountCalc.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPatterns 4 | { 5 | public class DayDiscountCalc:IDiscountCalaculator 6 | { 7 | public double GetDiscountValue(DateTime currentDate, string itemId) 8 | { 9 | // call database to calc today discount 10 | return 0.15; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /StructuralPatterns/Flyweight/DiscountCalcFactory.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace DesignPatterns 4 | { 5 | public class DiscountCalcFactory 6 | { 7 | public IDiscountCalaculator GetDiscountCalc(string calcType){ 8 | IDiscountCalaculator calaculator=null; 9 | Dictionary calcLst=new Dictionary (); 10 | 11 | if (calcLst.ContainsKey(calcType)){ 12 | return calcLst[calcType]; 13 | }else{ 14 | switch(calcType){ 15 | case "day": 16 | calaculator= new DayDiscountCalc(); 17 | calcLst.Add("day",calaculator); 18 | break; 19 | case "item": 20 | calaculator= new ItemsDiscountCalc(); 21 | calcLst.Add("item",calaculator); 22 | break; 23 | } 24 | return calaculator; 25 | } 26 | 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /StructuralPatterns/Flyweight/IDiscountCalaculator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPatterns 4 | { 5 | public interface IDiscountCalaculator 6 | { 7 | double GetDiscountValue(DateTime currentDate, string itemId=null); 8 | } 9 | } -------------------------------------------------------------------------------- /StructuralPatterns/Flyweight/ItemPriceCalc.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DesignPatterns 4 | { 5 | public class ItemsDiscountCalc:IDiscountCalaculator 6 | { 7 | 8 | public double GetDiscountValue(DateTime currentDate, string itemId) 9 | { 10 | // call database to calc item discount 11 | return 0.10; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /StructuralPatterns/Proxy/ConcereteSMSService.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace DesignPatterns.StructuralPatterns 3 | { 4 | public class ConcereteSMSService : SMSService 5 | { 6 | public override string SendSMS(string custId, string mobile, string sms) 7 | { 8 | return $"CustomerId {custId}, sms sent to {mobile}"; 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /StructuralPatterns/Proxy/SMSService.cs: -------------------------------------------------------------------------------- 1 | namespace DesignPatterns.StructuralPatterns 2 | { 3 | public abstract class SMSService 4 | { 5 | public abstract string SendSMS(string custId,string mobile, string sms); 6 | 7 | } 8 | } -------------------------------------------------------------------------------- /StructuralPatterns/Proxy/SMSServiceProxy.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | 4 | namespace DesignPatterns.StructuralPatterns 5 | { 6 | public class SMSServiceProxy 7 | { 8 | //ToDo: Count calls for each customer, if calls > 100 dont send sms 9 | private SMSService _smsService; 10 | Dictionary sentCount = new Dictionary (); 11 | public string SendSMS(string custId, string mobile, string sms) 12 | { 13 | if(_smsService == null) {_smsService = new ConcereteSMSService();} 14 | 15 | // first call 16 | if(!sentCount.ContainsKey(custId)){ 17 | sentCount.Add(custId,1); 18 | return _smsService.SendSMS(custId,mobile,sms); 19 | }else { 20 | var customer = sentCount.Where(x=>x.Key==custId).FirstOrDefault(); 21 | if(customer.Value >= 2) {return "Not sent!"; } 22 | else {sentCount[custId]= customer.Value+1; return _smsService.SendSMS(custId,mobile,sms);} 23 | } 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/DesignPatterns.deps.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeTarget": { 3 | "name": ".NETCoreApp,Version=v3.1", 4 | "signature": "" 5 | }, 6 | "compilationOptions": {}, 7 | "targets": { 8 | ".NETCoreApp,Version=v3.1": { 9 | "DesignPatterns/1.0.0": { 10 | "dependencies": { 11 | "Newtonsoft.Json": "12.0.3" 12 | }, 13 | "runtime": { 14 | "DesignPatterns.dll": {} 15 | } 16 | }, 17 | "Newtonsoft.Json/12.0.3": { 18 | "runtime": { 19 | "lib/netstandard2.0/Newtonsoft.Json.dll": { 20 | "assemblyVersion": "12.0.0.0", 21 | "fileVersion": "12.0.3.23909" 22 | } 23 | } 24 | } 25 | } 26 | }, 27 | "libraries": { 28 | "DesignPatterns/1.0.0": { 29 | "type": "project", 30 | "serviceable": false, 31 | "sha512": "" 32 | }, 33 | "Newtonsoft.Json/12.0.3": { 34 | "type": "package", 35 | "serviceable": true, 36 | "sha512": "sha512-6mgjfnRB4jKMlzHSl+VD+oUc1IebOZabkbyWj2RiTgWwYPPuaK1H97G1sHqGwPlS5npiF5Q0OrxN1wni2n5QWg==", 37 | "path": "newtonsoft.json/12.0.3", 38 | "hashPath": "newtonsoft.json.12.0.3.nupkg.sha512" 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/DesignPatterns.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Eng-MohammedReda/Design-Patterns/c9d5f709f2bababdb87b3db52a76fa39319fe9b5/bin/Debug/netcoreapp3.1/DesignPatterns.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/DesignPatterns.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Eng-MohammedReda/Design-Patterns/c9d5f709f2bababdb87b3db52a76fa39319fe9b5/bin/Debug/netcoreapp3.1/DesignPatterns.exe -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/DesignPatterns.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Eng-MohammedReda/Design-Patterns/c9d5f709f2bababdb87b3db52a76fa39319fe9b5/bin/Debug/netcoreapp3.1/DesignPatterns.pdb -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/DesignPatterns.runtimeconfig.dev.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "additionalProbingPaths": [ 4 | "C:\\Users\\mreda\\.dotnet\\store\\|arch|\\|tfm|", 5 | "C:\\Users\\mreda\\.nuget\\packages", 6 | "C:\\Microsoft\\Xamarin\\NuGet" 7 | ] 8 | } 9 | } -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/DesignPatterns.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "tfm": "netcoreapp3.1", 4 | "framework": { 5 | "name": "Microsoft.NETCore.App", 6 | "version": "3.1.0" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Eng-MohammedReda/Design-Patterns/c9d5f709f2bababdb87b3db52a76fa39319fe9b5/bin/Debug/netcoreapp3.1/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using System.Reflection; 4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v3.1", FrameworkDisplayName = "")] 5 | -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/DesignPatterns.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: System.Reflection.AssemblyCompanyAttribute("DesignPatterns")] 15 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] 16 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 17 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] 18 | [assembly: System.Reflection.AssemblyProductAttribute("DesignPatterns")] 19 | [assembly: System.Reflection.AssemblyTitleAttribute("DesignPatterns")] 20 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 21 | 22 | // Generated by the MSBuild WriteCodeFragment class. 23 | 24 | -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/DesignPatterns.AssemblyInfoInputs.cache: -------------------------------------------------------------------------------- 1 | 807181119eaafba7e0a34ed9743ffe02dcf83b54 2 | -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/DesignPatterns.assets.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Eng-MohammedReda/Design-Patterns/c9d5f709f2bababdb87b3db52a76fa39319fe9b5/obj/Debug/netcoreapp3.1/DesignPatterns.assets.cache -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/DesignPatterns.csproj.CopyComplete: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Eng-MohammedReda/Design-Patterns/c9d5f709f2bababdb87b3db52a76fa39319fe9b5/obj/Debug/netcoreapp3.1/DesignPatterns.csproj.CopyComplete -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/DesignPatterns.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | a8edf612de7587ce00b43e034cc39a8fac516662 2 | -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/DesignPatterns.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | D:\Library\Cources\Mine\Design Patterns\Design Patterns Examples\DesignPatterns\bin\Debug\netcoreapp3.1\DesignPatterns.exe 2 | D:\Library\Cources\Mine\Design Patterns\Design Patterns Examples\DesignPatterns\bin\Debug\netcoreapp3.1\DesignPatterns.deps.json 3 | D:\Library\Cources\Mine\Design Patterns\Design Patterns Examples\DesignPatterns\bin\Debug\netcoreapp3.1\DesignPatterns.runtimeconfig.json 4 | D:\Library\Cources\Mine\Design Patterns\Design Patterns Examples\DesignPatterns\bin\Debug\netcoreapp3.1\DesignPatterns.runtimeconfig.dev.json 5 | D:\Library\Cources\Mine\Design Patterns\Design Patterns Examples\DesignPatterns\bin\Debug\netcoreapp3.1\DesignPatterns.dll 6 | D:\Library\Cources\Mine\Design Patterns\Design Patterns Examples\DesignPatterns\bin\Debug\netcoreapp3.1\DesignPatterns.pdb 7 | D:\Library\Cources\Mine\Design Patterns\Design Patterns Examples\DesignPatterns\obj\Debug\netcoreapp3.1\DesignPatterns.csprojAssemblyReference.cache 8 | D:\Library\Cources\Mine\Design Patterns\Design Patterns Examples\DesignPatterns\obj\Debug\netcoreapp3.1\DesignPatterns.AssemblyInfoInputs.cache 9 | D:\Library\Cources\Mine\Design Patterns\Design Patterns Examples\DesignPatterns\obj\Debug\netcoreapp3.1\DesignPatterns.AssemblyInfo.cs 10 | D:\Library\Cources\Mine\Design Patterns\Design Patterns Examples\DesignPatterns\obj\Debug\netcoreapp3.1\DesignPatterns.csproj.CoreCompileInputs.cache 11 | D:\Library\Cources\Mine\Design Patterns\Design Patterns Examples\DesignPatterns\obj\Debug\netcoreapp3.1\DesignPatterns.dll 12 | D:\Library\Cources\Mine\Design Patterns\Design Patterns Examples\DesignPatterns\obj\Debug\netcoreapp3.1\DesignPatterns.pdb 13 | D:\Library\Cources\Mine\Design Patterns\Design Patterns Examples\DesignPatterns\obj\Debug\netcoreapp3.1\DesignPatterns.genruntimeconfig.cache 14 | D:\Examples\Design Patterns Examples\designpatterns\bin\Debug\netcoreapp3.1\DesignPatterns.exe 15 | D:\Examples\Design Patterns Examples\designpatterns\bin\Debug\netcoreapp3.1\DesignPatterns.deps.json 16 | D:\Examples\Design Patterns Examples\designpatterns\bin\Debug\netcoreapp3.1\DesignPatterns.runtimeconfig.json 17 | D:\Examples\Design Patterns Examples\designpatterns\bin\Debug\netcoreapp3.1\DesignPatterns.runtimeconfig.dev.json 18 | D:\Examples\Design Patterns Examples\designpatterns\bin\Debug\netcoreapp3.1\DesignPatterns.dll 19 | D:\Examples\Design Patterns Examples\designpatterns\bin\Debug\netcoreapp3.1\DesignPatterns.pdb 20 | D:\Examples\Design Patterns Examples\designpatterns\obj\Debug\netcoreapp3.1\DesignPatterns.csprojAssemblyReference.cache 21 | D:\Examples\Design Patterns Examples\designpatterns\obj\Debug\netcoreapp3.1\DesignPatterns.AssemblyInfoInputs.cache 22 | D:\Examples\Design Patterns Examples\designpatterns\obj\Debug\netcoreapp3.1\DesignPatterns.AssemblyInfo.cs 23 | D:\Examples\Design Patterns Examples\designpatterns\obj\Debug\netcoreapp3.1\DesignPatterns.csproj.CoreCompileInputs.cache 24 | D:\Examples\Design Patterns Examples\designpatterns\obj\Debug\netcoreapp3.1\DesignPatterns.dll 25 | D:\Examples\Design Patterns Examples\designpatterns\obj\Debug\netcoreapp3.1\DesignPatterns.pdb 26 | D:\Examples\Design Patterns Examples\designpatterns\obj\Debug\netcoreapp3.1\DesignPatterns.genruntimeconfig.cache 27 | D:\Examples\Design Patterns Examples\DesignPatterns\bin\Debug\netcoreapp3.1\Newtonsoft.Json.dll 28 | D:\Examples\Design Patterns Examples\DesignPatterns\obj\Debug\netcoreapp3.1\DesignPatterns.csproj.CopyComplete 29 | C:\Users\mreda\Desktop\DPGit\Design-Patterns\bin\Debug\netcoreapp3.1\DesignPatterns.exe 30 | C:\Users\mreda\Desktop\DPGit\Design-Patterns\bin\Debug\netcoreapp3.1\DesignPatterns.deps.json 31 | C:\Users\mreda\Desktop\DPGit\Design-Patterns\bin\Debug\netcoreapp3.1\DesignPatterns.runtimeconfig.json 32 | C:\Users\mreda\Desktop\DPGit\Design-Patterns\bin\Debug\netcoreapp3.1\DesignPatterns.runtimeconfig.dev.json 33 | C:\Users\mreda\Desktop\DPGit\Design-Patterns\bin\Debug\netcoreapp3.1\DesignPatterns.dll 34 | C:\Users\mreda\Desktop\DPGit\Design-Patterns\bin\Debug\netcoreapp3.1\DesignPatterns.pdb 35 | C:\Users\mreda\Desktop\DPGit\Design-Patterns\bin\Debug\netcoreapp3.1\Newtonsoft.Json.dll 36 | C:\Users\mreda\Desktop\DPGit\Design-Patterns\obj\Debug\netcoreapp3.1\DesignPatterns.csprojAssemblyReference.cache 37 | C:\Users\mreda\Desktop\DPGit\Design-Patterns\obj\Debug\netcoreapp3.1\DesignPatterns.AssemblyInfoInputs.cache 38 | C:\Users\mreda\Desktop\DPGit\Design-Patterns\obj\Debug\netcoreapp3.1\DesignPatterns.AssemblyInfo.cs 39 | C:\Users\mreda\Desktop\DPGit\Design-Patterns\obj\Debug\netcoreapp3.1\DesignPatterns.csproj.CoreCompileInputs.cache 40 | C:\Users\mreda\Desktop\DPGit\Design-Patterns\obj\Debug\netcoreapp3.1\DesignPatterns.csproj.CopyComplete 41 | C:\Users\mreda\Desktop\DPGit\Design-Patterns\obj\Debug\netcoreapp3.1\DesignPatterns.dll 42 | C:\Users\mreda\Desktop\DPGit\Design-Patterns\obj\Debug\netcoreapp3.1\DesignPatterns.pdb 43 | C:\Users\mreda\Desktop\DPGit\Design-Patterns\obj\Debug\netcoreapp3.1\DesignPatterns.genruntimeconfig.cache 44 | -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/DesignPatterns.csprojAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Eng-MohammedReda/Design-Patterns/c9d5f709f2bababdb87b3db52a76fa39319fe9b5/obj/Debug/netcoreapp3.1/DesignPatterns.csprojAssemblyReference.cache -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/DesignPatterns.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Eng-MohammedReda/Design-Patterns/c9d5f709f2bababdb87b3db52a76fa39319fe9b5/obj/Debug/netcoreapp3.1/DesignPatterns.dll -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/DesignPatterns.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Eng-MohammedReda/Design-Patterns/c9d5f709f2bababdb87b3db52a76fa39319fe9b5/obj/Debug/netcoreapp3.1/DesignPatterns.exe -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/DesignPatterns.genruntimeconfig.cache: -------------------------------------------------------------------------------- 1 | 86c8e15dd33445635927cfaf398408205fd11473 2 | -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/DesignPatterns.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Eng-MohammedReda/Design-Patterns/c9d5f709f2bababdb87b3db52a76fa39319fe9b5/obj/Debug/netcoreapp3.1/DesignPatterns.pdb -------------------------------------------------------------------------------- /obj/DesignPatterns.csproj.nuget.dgspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "format": 1, 3 | "restore": { 4 | "C:\\Users\\mreda\\Desktop\\DPGit\\Design-Patterns\\DesignPatterns.csproj": {} 5 | }, 6 | "projects": { 7 | "C:\\Users\\mreda\\Desktop\\DPGit\\Design-Patterns\\DesignPatterns.csproj": { 8 | "version": "1.0.0", 9 | "restore": { 10 | "projectUniqueName": "C:\\Users\\mreda\\Desktop\\DPGit\\Design-Patterns\\DesignPatterns.csproj", 11 | "projectName": "DesignPatterns", 12 | "projectPath": "C:\\Users\\mreda\\Desktop\\DPGit\\Design-Patterns\\DesignPatterns.csproj", 13 | "packagesPath": "C:\\Users\\mreda\\.nuget\\packages\\", 14 | "outputPath": "C:\\Users\\mreda\\Desktop\\DPGit\\Design-Patterns\\obj\\", 15 | "projectStyle": "PackageReference", 16 | "fallbackFolders": [ 17 | "C:\\Microsoft\\Xamarin\\NuGet\\" 18 | ], 19 | "configFilePaths": [ 20 | "C:\\Users\\mreda\\AppData\\Roaming\\NuGet\\NuGet.Config", 21 | "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", 22 | "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" 23 | ], 24 | "originalTargetFrameworks": [ 25 | "netcoreapp3.1" 26 | ], 27 | "sources": { 28 | "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, 29 | "https://api.nuget.org/v3/index.json": {} 30 | }, 31 | "frameworks": { 32 | "netcoreapp3.1": { 33 | "projectReferences": {} 34 | } 35 | }, 36 | "warningProperties": { 37 | "warnAsError": [ 38 | "NU1605" 39 | ] 40 | } 41 | }, 42 | "frameworks": { 43 | "netcoreapp3.1": { 44 | "dependencies": { 45 | "Newtonsoft.Json": { 46 | "target": "Package", 47 | "version": "[12.0.3, )" 48 | } 49 | }, 50 | "imports": [ 51 | "net461", 52 | "net462", 53 | "net47", 54 | "net471", 55 | "net472", 56 | "net48" 57 | ], 58 | "assetTargetFallback": true, 59 | "warn": true, 60 | "frameworkReferences": { 61 | "Microsoft.NETCore.App": { 62 | "privateAssets": "all" 63 | } 64 | }, 65 | "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.300\\RuntimeIdentifierGraph.json" 66 | } 67 | } 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /obj/DesignPatterns.csproj.nuget.g.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | True 5 | NuGet 6 | $(MSBuildThisFileDirectory)project.assets.json 7 | $(UserProfile)\.nuget\packages\ 8 | C:\Users\mreda\.nuget\packages\;C:\Microsoft\Xamarin\NuGet\ 9 | PackageReference 10 | 5.6.0 11 | 12 | 13 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 14 | 15 | -------------------------------------------------------------------------------- /obj/DesignPatterns.csproj.nuget.g.targets: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | 6 | -------------------------------------------------------------------------------- /obj/project.assets.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "targets": { 4 | ".NETCoreApp,Version=v3.1": { 5 | "Newtonsoft.Json/12.0.3": { 6 | "type": "package", 7 | "compile": { 8 | "lib/netstandard2.0/Newtonsoft.Json.dll": {} 9 | }, 10 | "runtime": { 11 | "lib/netstandard2.0/Newtonsoft.Json.dll": {} 12 | } 13 | } 14 | } 15 | }, 16 | "libraries": { 17 | "Newtonsoft.Json/12.0.3": { 18 | "sha512": "6mgjfnRB4jKMlzHSl+VD+oUc1IebOZabkbyWj2RiTgWwYPPuaK1H97G1sHqGwPlS5npiF5Q0OrxN1wni2n5QWg==", 19 | "type": "package", 20 | "path": "newtonsoft.json/12.0.3", 21 | "files": [ 22 | ".nupkg.metadata", 23 | ".signature.p7s", 24 | "LICENSE.md", 25 | "lib/net20/Newtonsoft.Json.dll", 26 | "lib/net20/Newtonsoft.Json.xml", 27 | "lib/net35/Newtonsoft.Json.dll", 28 | "lib/net35/Newtonsoft.Json.xml", 29 | "lib/net40/Newtonsoft.Json.dll", 30 | "lib/net40/Newtonsoft.Json.xml", 31 | "lib/net45/Newtonsoft.Json.dll", 32 | "lib/net45/Newtonsoft.Json.xml", 33 | "lib/netstandard1.0/Newtonsoft.Json.dll", 34 | "lib/netstandard1.0/Newtonsoft.Json.xml", 35 | "lib/netstandard1.3/Newtonsoft.Json.dll", 36 | "lib/netstandard1.3/Newtonsoft.Json.xml", 37 | "lib/netstandard2.0/Newtonsoft.Json.dll", 38 | "lib/netstandard2.0/Newtonsoft.Json.xml", 39 | "lib/portable-net40+sl5+win8+wp8+wpa81/Newtonsoft.Json.dll", 40 | "lib/portable-net40+sl5+win8+wp8+wpa81/Newtonsoft.Json.xml", 41 | "lib/portable-net45+win8+wp8+wpa81/Newtonsoft.Json.dll", 42 | "lib/portable-net45+win8+wp8+wpa81/Newtonsoft.Json.xml", 43 | "newtonsoft.json.12.0.3.nupkg.sha512", 44 | "newtonsoft.json.nuspec", 45 | "packageIcon.png" 46 | ] 47 | } 48 | }, 49 | "projectFileDependencyGroups": { 50 | ".NETCoreApp,Version=v3.1": [ 51 | "Newtonsoft.Json >= 12.0.3" 52 | ] 53 | }, 54 | "packageFolders": { 55 | "C:\\Users\\mreda\\.nuget\\packages\\": {}, 56 | "C:\\Microsoft\\Xamarin\\NuGet\\": {} 57 | }, 58 | "project": { 59 | "version": "1.0.0", 60 | "restore": { 61 | "projectUniqueName": "C:\\Users\\mreda\\Desktop\\DPGit\\Design-Patterns\\DesignPatterns.csproj", 62 | "projectName": "DesignPatterns", 63 | "projectPath": "C:\\Users\\mreda\\Desktop\\DPGit\\Design-Patterns\\DesignPatterns.csproj", 64 | "packagesPath": "C:\\Users\\mreda\\.nuget\\packages\\", 65 | "outputPath": "C:\\Users\\mreda\\Desktop\\DPGit\\Design-Patterns\\obj\\", 66 | "projectStyle": "PackageReference", 67 | "fallbackFolders": [ 68 | "C:\\Microsoft\\Xamarin\\NuGet\\" 69 | ], 70 | "configFilePaths": [ 71 | "C:\\Users\\mreda\\AppData\\Roaming\\NuGet\\NuGet.Config", 72 | "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config", 73 | "C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config" 74 | ], 75 | "originalTargetFrameworks": [ 76 | "netcoreapp3.1" 77 | ], 78 | "sources": { 79 | "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, 80 | "https://api.nuget.org/v3/index.json": {} 81 | }, 82 | "frameworks": { 83 | "netcoreapp3.1": { 84 | "projectReferences": {} 85 | } 86 | }, 87 | "warningProperties": { 88 | "warnAsError": [ 89 | "NU1605" 90 | ] 91 | } 92 | }, 93 | "frameworks": { 94 | "netcoreapp3.1": { 95 | "dependencies": { 96 | "Newtonsoft.Json": { 97 | "target": "Package", 98 | "version": "[12.0.3, )" 99 | } 100 | }, 101 | "imports": [ 102 | "net461", 103 | "net462", 104 | "net47", 105 | "net471", 106 | "net472", 107 | "net48" 108 | ], 109 | "assetTargetFallback": true, 110 | "warn": true, 111 | "frameworkReferences": { 112 | "Microsoft.NETCore.App": { 113 | "privateAssets": "all" 114 | } 115 | }, 116 | "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.300\\RuntimeIdentifierGraph.json" 117 | } 118 | } 119 | } 120 | } -------------------------------------------------------------------------------- /obj/project.nuget.cache: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "dgSpecHash": "0bT/Emwa5+YmQ4ttjUYoBg8EV6TqcWeJDN99Ru9TPmPq5JzEix5KJyfiLN7r8QG2ZWHndROX3azJn0+LBMOtfA==", 4 | "success": true, 5 | "projectFilePath": "C:\\Users\\mreda\\Desktop\\DPGit\\Design-Patterns\\DesignPatterns.csproj", 6 | "expectedPackageFiles": [ 7 | "C:\\Users\\mreda\\.nuget\\packages\\newtonsoft.json\\12.0.3\\newtonsoft.json.12.0.3.nupkg.sha512" 8 | ], 9 | "logs": [] 10 | } --------------------------------------------------------------------------------