Skip to content

ArghaRay00/solid-principles-csharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SOLID Principles in C#

Hands-on examples of SOLID principles using a simple shape area calculator in .NET Core. The master branch shows the code before applying the principle (the violation), and the srp branch shows the refactored version.

Single Responsibility Principle (SRP)

Before (master branch): AreaCalculator handles both area calculation AND console output — two reasons to change in one class.

After (srp branch): Calculation and output are separated into distinct responsibilities.

Running it

dotnet run

Tech

.NET Core 3.1, C# console application.

About

SOLID principles demonstrated in C# with before/after examples. SRP shown via shape area calculator refactoring.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages