diff --git a/AbstractFactory.Conceptual/AbstractFactory.Conceptual.csproj b/AbstractFactory.Conceptual/AbstractFactory.Conceptual.csproj index 8fa67b5..b3587f9 100644 --- a/AbstractFactory.Conceptual/AbstractFactory.Conceptual.csproj +++ b/AbstractFactory.Conceptual/AbstractFactory.Conceptual.csproj @@ -1,6 +1,6 @@  Exe - netcoreapp2.0 + net8.0 \ No newline at end of file diff --git a/Adapter.Conceptual/Adapter.Conceptual.csproj b/Adapter.Conceptual/Adapter.Conceptual.csproj index 5cd481b..ffc1a77 100644 --- a/Adapter.Conceptual/Adapter.Conceptual.csproj +++ b/Adapter.Conceptual/Adapter.Conceptual.csproj @@ -1,6 +1,6 @@ Exe - netcoreapp2.0 + net8.0 \ No newline at end of file diff --git a/Bridge.Conceptual/Bridge.Conceptual.csproj b/Bridge.Conceptual/Bridge.Conceptual.csproj index 8fa67b5..b3587f9 100644 --- a/Bridge.Conceptual/Bridge.Conceptual.csproj +++ b/Bridge.Conceptual/Bridge.Conceptual.csproj @@ -1,6 +1,6 @@  Exe - netcoreapp2.0 + net8.0 \ No newline at end of file diff --git a/Builder.Conceptual/Builder.Conceptual.csproj b/Builder.Conceptual/Builder.Conceptual.csproj index 8fa67b5..b3587f9 100644 --- a/Builder.Conceptual/Builder.Conceptual.csproj +++ b/Builder.Conceptual/Builder.Conceptual.csproj @@ -1,6 +1,6 @@  Exe - netcoreapp2.0 + net8.0 \ No newline at end of file diff --git a/ChainOfResponsibility.Conceptual/ChainOfResponsibility.Conceptual.csproj b/ChainOfResponsibility.Conceptual/ChainOfResponsibility.Conceptual.csproj index 8fa67b5..b3587f9 100644 --- a/ChainOfResponsibility.Conceptual/ChainOfResponsibility.Conceptual.csproj +++ b/ChainOfResponsibility.Conceptual/ChainOfResponsibility.Conceptual.csproj @@ -1,6 +1,6 @@  Exe - netcoreapp2.0 + net8.0 \ No newline at end of file diff --git a/Command.Conceptual/Command.Conceptual.csproj b/Command.Conceptual/Command.Conceptual.csproj index 8fa67b5..b3587f9 100644 --- a/Command.Conceptual/Command.Conceptual.csproj +++ b/Command.Conceptual/Command.Conceptual.csproj @@ -1,6 +1,6 @@  Exe - netcoreapp2.0 + net8.0 \ No newline at end of file diff --git a/Composite.Conceptual/Composite.Conceptual.csproj b/Composite.Conceptual/Composite.Conceptual.csproj index 8fa67b5..b3587f9 100644 --- a/Composite.Conceptual/Composite.Conceptual.csproj +++ b/Composite.Conceptual/Composite.Conceptual.csproj @@ -1,6 +1,6 @@  Exe - netcoreapp2.0 + net8.0 \ No newline at end of file diff --git a/Decorator.Conceptual/Decorator.Conceptual.csproj b/Decorator.Conceptual/Decorator.Conceptual.csproj index 8fa67b5..b3587f9 100644 --- a/Decorator.Conceptual/Decorator.Conceptual.csproj +++ b/Decorator.Conceptual/Decorator.Conceptual.csproj @@ -1,6 +1,6 @@  Exe - netcoreapp2.0 + net8.0 \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..fddb6d1 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,12 @@ + + + + + disable + disable + https://github.com/RefactoringGuru/design-patterns-csharp + Git + True + True + + \ No newline at end of file diff --git a/Facade.Conceptual/Facade.Conceptual.csproj b/Facade.Conceptual/Facade.Conceptual.csproj index 8fa67b5..b3587f9 100644 --- a/Facade.Conceptual/Facade.Conceptual.csproj +++ b/Facade.Conceptual/Facade.Conceptual.csproj @@ -1,6 +1,6 @@  Exe - netcoreapp2.0 + net8.0 \ No newline at end of file diff --git a/FactoryMethod.Conceptual/FactoryMethod.Conceptual.csproj b/FactoryMethod.Conceptual/FactoryMethod.Conceptual.csproj index 8fa67b5..b3587f9 100644 --- a/FactoryMethod.Conceptual/FactoryMethod.Conceptual.csproj +++ b/FactoryMethod.Conceptual/FactoryMethod.Conceptual.csproj @@ -1,6 +1,6 @@  Exe - netcoreapp2.0 + net8.0 \ No newline at end of file diff --git a/Flyweight.Conceptual/Flyweight.Conceptual.csproj b/Flyweight.Conceptual/Flyweight.Conceptual.csproj index 3bb526c..d47c375 100644 --- a/Flyweight.Conceptual/Flyweight.Conceptual.csproj +++ b/Flyweight.Conceptual/Flyweight.Conceptual.csproj @@ -1,9 +1,9 @@  Exe - netcoreapp2.0 + net8.0 - + \ No newline at end of file diff --git a/Flyweight.Conceptual/Program.cs b/Flyweight.Conceptual/Program.cs index 40020e0..ba3c0e1 100644 --- a/Flyweight.Conceptual/Program.cs +++ b/Flyweight.Conceptual/Program.cs @@ -13,11 +13,11 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text.Json; // EN: Use Json.NET library, you can download it from NuGet Package Manager // // RU: Используем библиотеку Json.NET, загрузить можно через NuGet Package // Manager -using Newtonsoft.Json; namespace RefactoringGuru.DesignPatterns.Flyweight.Conceptual { @@ -41,8 +41,8 @@ public Flyweight(Car car) public void Operation(Car uniqueState) { - string s = JsonConvert.SerializeObject(this._sharedState); - string u = JsonConvert.SerializeObject(uniqueState); + string s = JsonSerializer.Serialize(this._sharedState); + string u = JsonSerializer.Serialize(uniqueState); Console.WriteLine($"Flyweight: Displaying shared {s} and unique {u} state."); } } diff --git a/Iterator.Conceptual/Iterator.Conceptual.csproj b/Iterator.Conceptual/Iterator.Conceptual.csproj index 8fa67b5..b3587f9 100644 --- a/Iterator.Conceptual/Iterator.Conceptual.csproj +++ b/Iterator.Conceptual/Iterator.Conceptual.csproj @@ -1,6 +1,6 @@  Exe - netcoreapp2.0 + net8.0 \ No newline at end of file diff --git a/Mediator.Conceptual/Mediator.Conceptual.csproj b/Mediator.Conceptual/Mediator.Conceptual.csproj index 8fa67b5..b3587f9 100644 --- a/Mediator.Conceptual/Mediator.Conceptual.csproj +++ b/Mediator.Conceptual/Mediator.Conceptual.csproj @@ -1,6 +1,6 @@  Exe - netcoreapp2.0 + net8.0 \ No newline at end of file diff --git a/Memento.Conceptual/Memento.Conceptual.csproj b/Memento.Conceptual/Memento.Conceptual.csproj index 8fa67b5..b3587f9 100644 --- a/Memento.Conceptual/Memento.Conceptual.csproj +++ b/Memento.Conceptual/Memento.Conceptual.csproj @@ -1,6 +1,6 @@  Exe - netcoreapp2.0 + net8.0 \ No newline at end of file diff --git a/Observer.Conceptual/Observer.Conceptual.csproj b/Observer.Conceptual/Observer.Conceptual.csproj index 8fa67b5..b3587f9 100644 --- a/Observer.Conceptual/Observer.Conceptual.csproj +++ b/Observer.Conceptual/Observer.Conceptual.csproj @@ -1,6 +1,6 @@  Exe - netcoreapp2.0 + net8.0 \ No newline at end of file diff --git a/Prototype.Conceptual/Prototype.Conceptual.csproj b/Prototype.Conceptual/Prototype.Conceptual.csproj index 8fa67b5..b3587f9 100644 --- a/Prototype.Conceptual/Prototype.Conceptual.csproj +++ b/Prototype.Conceptual/Prototype.Conceptual.csproj @@ -1,6 +1,6 @@  Exe - netcoreapp2.0 + net8.0 \ No newline at end of file diff --git a/Proxy.Conceptual/Proxy.Conceptual.csproj b/Proxy.Conceptual/Proxy.Conceptual.csproj index 8fa67b5..b3587f9 100644 --- a/Proxy.Conceptual/Proxy.Conceptual.csproj +++ b/Proxy.Conceptual/Proxy.Conceptual.csproj @@ -1,6 +1,6 @@  Exe - netcoreapp2.0 + net8.0 \ No newline at end of file diff --git a/README.md b/README.md index 2e59f20..1313fe6 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,12 @@ This repository is part of the [Refactoring.Guru](https://refactoring.guru/desig It contains C# examples for all classic GoF design patterns. Each pattern includes two examples: - [x] **Conceptual** examples show the internal structure of patterns with detailed comments. -- [ ] **RealWold** examples show how the patterns can be used in a real-world C# application. +- [ ] **RealWorld** examples show how the patterns can be used in a real-world C# application. ## Requirements -Most examples are console apps built using .NET Core 2.0. +Most examples are console apps built using C# .NET 8.0. For the best experience, we recommend working with examples with these IDEs: diff --git a/Singleton.Conceptual/NonThreadSafe/Singleton.Conceptual.NonThreadSafe.csproj b/Singleton.Conceptual/NonThreadSafe/Singleton.Conceptual.NonThreadSafe.csproj index 8fa67b5..b3587f9 100644 --- a/Singleton.Conceptual/NonThreadSafe/Singleton.Conceptual.NonThreadSafe.csproj +++ b/Singleton.Conceptual/NonThreadSafe/Singleton.Conceptual.NonThreadSafe.csproj @@ -1,6 +1,6 @@  Exe - netcoreapp2.0 + net8.0 \ No newline at end of file diff --git a/Singleton.Conceptual/ThreadSafe/Singleton.Conceptual.ThreadSafe.csproj b/Singleton.Conceptual/ThreadSafe/Singleton.Conceptual.ThreadSafe.csproj index 8fa67b5..b3587f9 100644 --- a/Singleton.Conceptual/ThreadSafe/Singleton.Conceptual.ThreadSafe.csproj +++ b/Singleton.Conceptual/ThreadSafe/Singleton.Conceptual.ThreadSafe.csproj @@ -1,6 +1,6 @@  Exe - netcoreapp2.0 + net8.0 \ No newline at end of file diff --git a/State.Conceptual/State.Conceptual.csproj b/State.Conceptual/State.Conceptual.csproj index 8fa67b5..b3587f9 100644 --- a/State.Conceptual/State.Conceptual.csproj +++ b/State.Conceptual/State.Conceptual.csproj @@ -1,6 +1,6 @@  Exe - netcoreapp2.0 + net8.0 \ No newline at end of file diff --git a/Strategy.Conceptual/Strategy.Conceptual.csproj b/Strategy.Conceptual/Strategy.Conceptual.csproj index 8fa67b5..b3587f9 100644 --- a/Strategy.Conceptual/Strategy.Conceptual.csproj +++ b/Strategy.Conceptual/Strategy.Conceptual.csproj @@ -1,6 +1,6 @@  Exe - netcoreapp2.0 + net8.0 \ No newline at end of file diff --git a/TemplateMethod.Conceptual/TemplateMethod.Conceptual.csproj b/TemplateMethod.Conceptual/TemplateMethod.Conceptual.csproj index 8fa67b5..b3587f9 100644 --- a/TemplateMethod.Conceptual/TemplateMethod.Conceptual.csproj +++ b/TemplateMethod.Conceptual/TemplateMethod.Conceptual.csproj @@ -1,6 +1,6 @@  Exe - netcoreapp2.0 + net8.0 \ No newline at end of file diff --git a/Visitor.Conceptual/Visitor.Conceptual.csproj b/Visitor.Conceptual/Visitor.Conceptual.csproj index 8fa67b5..b3587f9 100644 --- a/Visitor.Conceptual/Visitor.Conceptual.csproj +++ b/Visitor.Conceptual/Visitor.Conceptual.csproj @@ -1,6 +1,6 @@  Exe - netcoreapp2.0 + net8.0 \ No newline at end of file