This repository contains a Visual Studio Code solution for implementing various design patterns in C# using .NET Core. Each design pattern is implemented in a separate console project within the solution.
The repository is organized as follows:
DesignPatternsSolution/
│
├── SingletonPattern/
│ ├── Program.cs
│ └── ...
│
├── FactoryPattern/
│ ├── Program.cs
│ └── ...
│
├── BuilderPattern/
│ ├── Program.cs
│ └── ...
│
├── ...
Each folder represents a design pattern and contains a console project that implements that specific pattern.
- Open a terminal and navigate to the directory of the project you want to run. For example, to run the Singleton pattern:
cd /path/to/project/DesignPatternsSolution/SingletonPattern- Build the project using the
dotnet buildcommand:
dotnet build- Once built, run the program using the
dotnet runcommand:
dotnet runThis command will build the project if necessary and then execute the application.
If you want to run a specific project instead of all projects in the solution, you can specify the project name after the dotnet run command. For example:
dotnet run --project SingletonPatternThis will run only the SingletonPattern project. Replace SingletonPattern with the name of the project you want to run.
- Singleton
- Factory
- Builder
- Dependency Injection
- Adapter
- Decorator
- Facade
- Bridge
- Observer
- Command
- Strategy
Each design pattern is implemented in its own project and contains code examples demonstrating its usage.